Excel: get data from file 1 to file 2 but only from rows with specific data

34 views Asked by At

Let's say there's file 1 , which contains names in column A and some numbers in column B. Names can repeat, but not always in the same rows. I want to get sum of values in column B but only for specific name. Trick is that I can't mess with file 1 , since it is created automatically

I know how to link values from specific cell in other excel file, but I dunno how pull them based on data in another column

2

There are 2 answers

0
Ty Long On

Copying a worksheet from one workbook to another is possible and it has some useful VBA code that might help you out here. https://www.excelcampus.com/vba/copy-paste-another-workbook/.

1
RockET On

If it's easier, you don't even need to copy from File 1, you can do a SUMIF statement in another file in the form:

=SUMIF([File1.xlsx]Sheet_Name!$A:$A,"NAME",[File1]Sheet_Name!$B:$B)

That will sum every value in column B where you replace NAME with the specified value.