# IF and Index Match

#### jamesmev

##### Board Regular
I am trying to avoid using vlookup... That might be the most over used statement in Excel world.

I have a sheet where I need the result if two criteria are met.
For simplicity I'll try to explain below

A B C
NAME Date Total

So if you have on sheet 1 "Name" and it falls within "Date" it provides "total"

Any help would be appreciated... This might be one of those .... DUH formula's but - my brain is broken.

### Excel Facts

If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

#### duggie33

##### Board Regular
Are you looking to return a single value, sum multiple values that meet the name and date requirements, or something else?

I personally think vlookup is useful for certain situations...it's simple.

#### AhoyNC

##### Well-known Member
Maybe something like one of the below formulas (it would help to post an example with the expected resulted).

The INDEX AGGREGATE formula in C8 will work in Excel 2010 or later.
If you have an earlier ver. then maybe something like the formula in C9 which must be entered with CTRL-SHIFT-ENTER.
Excel Workbook
ABC
1NAMEDateTotal
2Mary Smith2/5/201945
3Becky Jones3/5/201956
5
6
7Lookup
8Becky Jones3/5/201956
956
Sheet

#### jamesmev

##### Board Regular
Maybe something like one of the below formulas (it would help to post an example with the expected resulted).

The INDEX AGGREGATE formula in C8 will work in Excel 2010 or later.
If you have an earlier ver. then maybe something like the formula in C9 which must be entered with CTRL-SHIFT-ENTER.

 A B C 1 NAME Date Total 2 Mary Smith 2/5/2019 45 3 Becky Jones 3/5/2019 56 4 Sam Spade 3/1/2019 68 5 6 7 Lookup 8 Becky Jones 3/5/2019 56 9 56

<colgroup><col style="width:30px; "><col style="width:90px;"><col style="width:86px;"><col style="width:76px;"></colgroup><tbody>
</tbody>

 Cell Formula C8 =INDEX(\$C\$2:\$C\$4,AGGREGATE(15,6,(ROW(\$A\$2:\$A\$4)-ROW(\$A\$2)+1)/((\$A\$2:\$A\$4=\$A\$8)*(\$B\$2:\$B\$4=\$B\$8)),1)) C9 {=INDEX(\$C\$2:\$C\$4,MATCH(1,(\$A\$2:\$A\$4=A8)*(\$B\$2:\$B\$4=\$B\$8),0))}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>

Excel tables to the web >> Excel Jeanie HTML 4

The Aggregate works perfectly. I am running into an issue that the data is a Pivot.. Is there a way to combat that? I am getting a NUM error?
Any Ideas?

#### jamesmev

##### Board Regular

It appears to be the reference to a secondary sheet. . . The formula lives on Sheet 1 - - - the data lives on Sheet 2. When I reference the 2nd sheet is where I'm getting the issue. The Pivot isn't creating the problem.

#### AhoyNC

##### Well-known Member
See if this example helps using 2 sheets.

Excel Workbook
ABC
1Lookup
2Becky Jones3/5/201956
Sheet1
Excel Workbook
ABC
1NAMEDateTotal
2Mary Smith2/5/201945
3Becky Jones3/5/201956
Sheet2

#### jamesmev

##### Board Regular
Thank you. I appreciate it. I believe this has been resolved. Great help!

#### AhoyNC

##### Well-known Member
You're welcome. Thanks for the feedback.

Replies
3
Views
90
Replies
1
Views
44
Replies
1
Views
62
Replies
6
Views
52
Replies
40
Views
3K

1,109,426
Messages
5,528,690
Members
409,830
Latest member
KT50

### This Week's Hot Topics

• Change military grades into rank
Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
• VBA COUNTIF SOLUTION
Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
• INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...