0

I am trying to use Excel's index match functions to pull data from one spreadsheet into another. For now, I am trying to get it to work with the data in a separate tab, but eventually I would like to pull the data in from a separate file.

The spreadsheet with input data looks like this: The spreadsheet with input data looks like this:

The spreadsheet with the output/formulas looks like this: The spreadsheet with the output/formulas looks like this:

This is the formula that's in cell B2 of the output spreadsheet, but it's returning a #VALUE! error:

=INDEX(extract!$D$2:$D$2000,MATCH($B1&$A2,extract!$A$2:$A$2000&extract!$B$2:$B$2000&extract!$C$2:$C$2000,0),1)
2
  • Have you tried using a SUMIFS() formula? Commented Sep 17, 2014 at 14:51
  • I want to look things up using multiple keys. Would SUMIFS still apply? Commented Sep 17, 2014 at 14:54

2 Answers 2

1

See my solution below, SUMIFS() works because it allows you to get the sum of a column based on multiple criteria:

=SUMIFS($D$2:$D$7,$C$2:$C$7,$F2,$B$2:$B$7,G$1)

You can drag the formula across and down

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

The above solution seems to be hard coded to specific cells. I need to search column D (student_age_count) to find a value that matches whatever is in columns A, B and C.
It is hardcoded for the example because it needs to be hardcoded that way so that you can drag it from cell G2 to cell I7. The format for the SUMIFS() formula is as follows: SUMIFS(Sum_range, range_1, criteria_for_range1, range_2, criteria_for_range2). Easier than rewriting the formula for your cell references is just pressing F2 button on cell G2 and dragging my ranges to suit yours
=SUMIFS(Extract!$D$2:$D$7,Extract!$C$2:$C$7,$A2,Extract!$B$2:$B$7,B$1)
0

In the receiving worksheet's B2 use this standard (non-array) formula.

=IFERROR(INDEX(Extract!$D$2:$D$7,MIN(INDEX(ROW($1:$6)+((Extract!$B$2:$B$7<>B$1)+(Extract!$C$2:$C$7<>$A2))*1E+99,,))),0)

Fill both right and down.

       enter image description here

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.