Vlookup/IndexMatch if value is found in a range

bnbcat

New Member
Joined
Apr 27, 2016
Messages
41
Office Version
  1. 365
Platform
  1. Windows
Hello!

I just returned to work from maternity leave and my brain is a little fuzzy. This seems like a pretty simple lookup, and I'm 99% overthinking this, but I can't figure it out, and Googling hasn't been helpful. Any help is appreciated!

The table looks like the below, and I need the formula to find the specified time period (columns A-C) and pull the period (column D).

ABCD
1YEARH1H2Period
220202020 H12020 H2Per 1
320212021 H12021 H2Per 2
420222022 H12022 H2Per 3

IE: 2021 H1

I need a formula that would searches the above table, finds that 2021 H1 exists in row 3 and will therefore pull Period 2.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
+Fluff 1.xlsm
ABCDEFGHI
1YEARH1H2Period
220202020 H12020 H2Per 12021 H1Per 2
320212021 H12021 H2Per 2
420222022 H12022 H2Per 3
5
Sheet2
Cell Formulas
RangeFormula
I2I2=INDEX(D2:D4,MATCH(H2,INDEX(B2:C4,,MATCH(RIGHT(H2,2),B1:C1,0)),0))
 
Upvote 0
Solution
I suggest that you update your Account details (click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
+Fluff 1.xlsm
ABCDEFGHI
1YEARH1H2Period
220202020 H12020 H2Per 12021 H1Per 2
320212021 H12021 H2Per 2
420222022 H12022 H2Per 3
5
Sheet2
Cell Formulas
RangeFormula
I2I2=INDEX(D2:D4,MATCH(H2,INDEX(B2:C4,,MATCH(RIGHT(H2,2),B1:C1,0)),0))
Worked perfectly! I've also updated my info. Thank you so much!
 
Upvote 0
You're welcome, thanks for the feedback & updating your profile.
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

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