Match with Index and Match

rex759

Well-known Member
Joined
Nov 8, 2004
Messages
610
Office Version
  1. 365
Platform
  1. Windows
Hello,
I’m unsure what formula will work correctly for this situation.

I thought I could use a combination of Match and index and match but it only works for the first column and can’t seem to get it to work for the rest.

Basically, if the number in cell F2 entered does not match a number in column A, move to column B. If still not a match, then move to column C.

For example, if 1240 is entered in cell F2, the result should be 1241.

Any help is appreciated.
Excel Workbook
ABCDEFG
11111123412358987Enter a #Result
2123712391240124111111234
3
4
5
Sheet1
Excel 2010
Cell Formulas
RangeFormula
G2=IF(MATCH(F2,A:A,0),INDEX(B:B,MATCH(F2,A:A,0),0),IF(MATCH(F2,B:B,0),INDEX(C:C,MATCH(F2,B:B,0),0),IF(MATCH(F2,C:C,0),INDEX(D:D,MATCH(F2,C:C,0),0),"")))
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
There is probably a better way, but try:

Code:
=IFERROR(INDEX(A1:D2,SMALL(IF(A1:D2=F2,ROW(A1:A2)-ROW(A1)+1),1),SMALL(IF(A1:D2=F2,COLUMN(A1:D1)-COLUMN(A1)+1),1)+1),"")
Array entered, i.e. with CTRL+SHIFT+ENTER.

I've assumed that you'd just want a blank shown if the # entered was in Column D.

Matty
 
Upvote 0
Hello,
I’m unsure what formula will work correctly for this situation.

I thought I could use a combination of Match and index and match but it only works for the first column and can’t seem to get it to work for the rest.

Basically, if the number in cell F2 entered does not match a number in column A, move to column B. If still not a match, then move to column C.

For example, if 1240 is entered in cell F2, the result should be 1241.

Any help is appreciated.

Excel Workbook
ABCDEFG
11111123412358987Enter a #Result
2123712391240124111111234
3
4
5
Sheet1
Excel 2010
Cell Formulas
RangeFormula
G2=IF(MATCH(F2,A:A,0),INDEX(B:B,MATCH(F2,A:A,0),0),IF(MATCH(F2,B:B,0),INDEX(C:C,MATCH(F2,B:B,0),0),IF(MATCH(F2,C:C,0),INDEX(D:D,MATCH(F2,C:C,0),0),"")))
As long as the lookup value is unique, try this...

=SUMIF(A1:C2,F2,B1:D2)
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,845
Members
452,948
Latest member
UsmanAli786

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top