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

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
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,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

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