Locating first and last non-zero value cells based on value of cell value in COL A

Darren_workforce

Board Regular
Joined
Oct 13, 2022
Messages
128
Office Version
  1. 365
Platform
  1. Windows
I have the following formulas that pull the first and last non-zero cells and populate the header (time interval) in the respective column on the MON tab.
=INDEX(MON!$B$5:$AQ$5,MATCH(TRUE,INDEX(MON!B6:AQ6<>0,),0)) first non-zero in the row
=INDEX(MON!$B$5:$AQ$5,MATCH(TRUE,INDEX(MON!B6:AQ6<>0,),1)) last non-zero in the row.
1668136068864.png


The thing I'd like help with is my AGENT tab. I have a list of employee down column B. If John Smith's name is in B2, then C2 should display 8:00 (first non-zero his row on the MON tab).

Lastly, if the formula is not terribly long, I'd like to try and concatenate C2 so that it would read "first non-zero cell time interval" &" - " &"last non-zero cell time interval"
1668135991482.png

Any help is greatly appreciated!!
 

Attachments

  • 1668135890258.png
    1668135890258.png
    4.6 KB · Views: 9
  • 1668135989435.png
    1668135989435.png
    2.2 KB · Views: 10

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!

Forum statistics

Threads
1,215,035
Messages
6,122,785
Members
449,095
Latest member
m_smith_solihull

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