Formula to find the first and last cell containing data in a row

Leydenhousen

New Member
Joined
Jul 28, 2023
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi I am looking for a formula to find the first and last cell of data in a row. This data is to determine start and end dates and needs to return data from the header row as a return. So in the example below I want to know that Job A starts in Apr 23 and finishes in Aug 23. Can you please help explain what formula I should use please?

Jan 23 Feb 23 Mar 23 Apr 23 May 23 Jun 23 Jul 23Aug 23Sep 23
Job A100020030500050
Job B20002000200200002000
Job C3333333
Job D555
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi & welcome to MrExcel.
How about
Fluff.xlsm
ABCDEFGHIJKL
1Jan-23Feb-23Mar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23
2Job A10002003050005001/04/202301/08/2023
3Job B2000200020020000200001/02/202301/06/2023
4Job C333333301/03/202301/09/2023
5Job D55501/07/202301/09/2023
Master
Cell Formulas
RangeFormula
K2:L5K2=CHOOSECOLS(FILTER($B$1:$J$1,B2:J2<>""),1,-1)
Dynamic array formulas.
 
Upvote 0
Hi & welcome to MrExcel.
How about
Fluff.xlsm
ABCDEFGHIJKL
1Jan-23Feb-23Mar-23Apr-23May-23Jun-23Jul-23Aug-23Sep-23
2Job A10002003050005001/04/202301/08/2023
3Job B2000200020020000200001/02/202301/06/2023
4Job C333333301/03/202301/09/2023
5Job D55501/07/202301/09/2023
Master
Cell Formulas
RangeFormula
K2:L5K2=CHOOSECOLS(FILTER($B$1:$J$1,B2:J2<>""),1,-1)
Dynamic array formulas.
Sorry daft question but how do I write that as a formula to *** range and return the answer to K2
 
Upvote 0
Sorry but I don't understand what you are asking.
 
Upvote 0
Do you have the FILTER function?
 
Upvote 0
Do you also have the CHOOSECOLS function?
 
Upvote 0
Ok, how about
Excel Formula:
=LET(f,FILTER($B$1:$J$1,B2:J2<>""),CHOOSE({1,2},INDEX(f,,1),INDEX(f,,COLUMNS(f))))
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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