Index / match

leopardhawk

Well-known Member
Joined
May 31, 2007
Messages
611
Office Version
  1. 2016
Platform
  1. Windows
Trying to create a formula that will search column B for the number 69 and return the corresponding value from the same row in column G.

Having a brain cramp.

Thanks for any assistance!
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Re: need help with INDEX / MATCH

How about
=INDEX($G$2:$G$20,MATCH(69,$B$2:$B$20,0))
 
Upvote 0
Re: need help with INDEX / MATCH

In this particular case, cell B19 has the 69 and the value to be returned from G19 is 122712 but your suggestion is returning 0. By the way, I should also politely request that the formula always return a zero (0) if the number 69 cannot be found in column B.
 
Upvote 0
Re: need help with INDEX / MATCH

Code:
=iferror(index($g$2:$g$21,match(69,b2:b21,0)),0)
 
Upvote 0
Re: need help with INDEX / MATCH

If it's returning 0 then there is nothing in col G for the first instance of 69 in col B
Are you sure that B19 is the first instance of 69?
Also do you have any merged cells?
 
Upvote 0
Re: need help with INDEX / MATCH

Appreciate your help.

Yes, B19 is the first and only instance of 69 and the number 122712 is in G19. There are merged cells above the array that I am using on the worksheet which just happens to be B16:B100 and G16:G100. Will this affect the results?
 
Upvote 0
Re: need help with INDEX / MATCH

As long as none of the cells in B16:B100 or G16:G100 are merged then it shouldn't be a problem, but if F9:G19 were merged then it would return 0.


Excel 2013/2016
BCDEFG
13122712
14
15
1666122709
1767122710
1868122711
1969122712
2070122713
2171122714
2272122715
2373122716
2474122717
2575122718
2676122719
2777122720
Sheet3
Cell Formulas
RangeFormula
E13=INDEX($G$16:$G$100,MATCH(69,$B$16:$B$100,0))
 
Upvote 0
Re: need help with INDEX / MATCH

Fluff, I'm embarrassed. Your formula works perfectly! Hard for me to admit but I had column G wrong, it's column F... must be too early in the day for me or maybe I didn't get enough sleep last night. Sorry about that! Appreciate your help very much!
 
Upvote 0
Re: need help with INDEX / MATCH

Not a problem, we've all been there.

If you use this it will return a 0 if no match id found
=IFERROR(INDEX($F$16:$F$100,MATCH(69,$B$16:$B$100,0)),0)
 
Upvote 0
Re: need help with INDEX / MATCH

Thank you, that also works as intended. However this has brought a new problem to light. While 90%+ of the users will be younger than 69, if the user is 70 or older, the number 69 will not be in column B at all and while it's not giving an error, I am wondering if it's possible to have the formula return the amount in F16 if the user is past age 69?
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,324
Members
452,635
Latest member
laura12345

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