# excel help - index match formula with if conditon

#### Mallesh23

##### Well-known Member
Hi Team,

Below is my data and expected output is in Column G,
By combining column E and F, extract value from Column C,
and criteria is Column D value should be greater than 0.

Below formula works, without conditon of criteria D.
'=INDEX(\$C\$2:\$C\$4,MATCH(\$F2&"|"&\$E2,\$A\$2:\$A\$4&"|"&\$B\$2:\$B\$4,0))

Book1
ABCDEFG
1InvoiceTicketAmountxxxTicketInvoiceExpected Output
267811150000111678-
367533310001444675-
4672222800022226728000
5671444100036714441000
6
7=INDEX(\$C\$2:\$C\$4,MATCH(\$F2&"|"&\$E2,\$A\$2:\$A\$4&"|"&\$B\$2:\$B\$4,0))
Sheet1

Thanks
mg

### Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

#### Mallesh23

##### Well-known Member
Hi Team,

I am trying below formula, but its not working,
expected output shown in Column h.

=IF(D2>0,IFERROR(INDEX(\$C\$2:\$C\$4,MATCH(\$F2&"|"&\$E2,\$A\$2:\$A\$4&"|"&\$B\$2:\$B\$4,0)),"-"),"-")

Book1
ABCDEFGH
1InvoiceTicketAmountxxxTicketInvoiceExpected OutputExpected Output
267811150000111678--
367533310001444675--
467222280002222672-8000
567144410003671444-1000
6
7
Sheet1
Cell Formulas
RangeFormula
G2:G5G2=IF(D2>0,IFERROR(INDEX(\$C\$2:\$C\$4,MATCH(\$F2&"|"&\$E2,\$A\$2:\$A\$4&"|"&\$B\$2:\$B\$4,0)),"-"),"-")
Press CTRL+SHIFT+ENTER to enter array formulas.

Thanks
mg

#### Fluff

##### MrExcel MVP, Moderator
Delete G2:G5, then put the formula into G2 confirm it with CSE & then drag the formula down.

#### Mallesh23

##### Well-known Member
Hi Fluff,

Wow, great observation , it worked. ?

=IF(D5>0,IFERROR(INDEX(\$C\$2:\$C\$5,MATCH(\$F5&"|"&\$E5,\$A\$2:\$A\$5&"|"&\$B\$2:\$B\$5,0)),"-"),"-")

Thanks
mg

#### Fluff

##### MrExcel MVP, Moderator
You're welcome & thanks for the feedback.

Replies
4
Views
628
Replies
3
Views
187
Replies
6
Views
902
Replies
14
Views
498
Replies
10
Views
552

1,186,105
Messages
5,955,862
Members
438,222
Latest member
nalij_bond

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back