First (and last) occurrence of set of values in a row gives corresponding column value

jimmychacha

New Member
Joined
Apr 23, 2024
Messages
2
Office Version
  1. 365
Platform
  1. MacOS
Hi there,

This is my first post, I'm a big fan of this forum, it has helped me in many a sticky situation. So want to say a huge thank you to the community here for all your generous help and hard work.

This following sticky situation however has really stumped me...

1713878831357.png


I am looking for the following formulas:

1: In Column H, it would find the first occurrence of either "1" or "2" in the range A$:G$, and give the corresponding date in Row 1 of the column where it appears.
2: In Column I, it would find the last occurrence of either "3" or "4" in the range A$:G$, and give the corresponding date in Row 1 of the column where it appears.

For example, in cell H2, the formula would find the first column in row H where "1" or "2" appears (in this case D2), and give the corresponding date in that column (in this case D1).

Thank you in advance!
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Well spotted, you're absolutely right of course, I2 was incorrect.

Thank you so much for the speedy response, that solution a treat! Much appreciated! :)
 
Upvote 0

Forum statistics

Threads
1,224,815
Messages
6,181,135
Members
453,021
Latest member
Justyna P

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