Formula to tell the first non-blank in a range

Rainbow_P

New Member
Joined
May 6, 2022
Messages
21
Office Version
  1. 365
Platform
  1. Windows
Good day!

Can you please help me with a formula that can indicate the first instance of non-blank cell in a range?

Sample as screenshot, row #3 (B3:G3) has 2 numbers. A formula is needed to indicate D3 is the first instance of non-blank in the range.

I've tried =SUMPRODUCT(--($B$3:G3<>""))=0, but not really.

Thank you.

456.png
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
In H2, formula copied down :

=INDEX(B2:G2,INDEX(MATCH(1,B2:G2^0,),))
 
Upvote 0
A cell cannot have both a constant value and a formula... it is one or the other. If, based on the two pictures you posted, cell E2 has the number 21 in it, then you cannot put a formula in that cell to display the word "FIRST".
 
Upvote 0
In H2, formula copied down :

=INDEX(B2:G2,INDEX(MATCH(1,B2:G2^0,),))
@bosco_yip , thank you for your help.
sorry for the confusion - I meant, to have another correspondent 6 new columns (in addition to the originals A to G) to indicate the where the "First".
 
Upvote 0
A cell cannot have both a constant value and a formula... it is one or the other. If, based on the two pictures you posted, cell E2 has the number 21 in it, then you cannot put a formula in that cell to display the word "FIRST".
@Rick Rothstein , thank you for your reply.

sorry for the confusion - I meant, to have another correspondent 6 new columns (in addition to the originals A to G) to indicate the where the "First". Like:
 

Attachments

  • 456.png
    456.png
    10.6 KB · Views: 4
Upvote 0
Something along these lines?

tally.xlsb
ABCDEFGHIJKLMNOP
1Name2021-112021-122022-012022-022022-032022-04Name2021-112021-122022-012022-022022-032022-04
2Harper21Harper   First  
3Evelyn157Evelyn  First   
4Ben81721Ben  First   
5
6Name2021-112021-122022-012022-022022-032022-04
7Harper   First  
8Evelyn  First   
9Ben  First   
10
Sheet3
Cell Formulas
RangeFormula
J2:J4J2=IF(AND(COUNTA(A2:$B2)=0,B2<>""),"First","")
K2:O4K2=IF(AND(COUNTA($B2:B2)=0,C2<>""),"First","")
B7:B9B7=IF(AND(COUNTA(A2:$B2)=0,B2<>""),"First","")
C7:G9C7=IF(AND(COUNTA($B2:B2)=0,C2<>""),"First","")
 
Upvote 0
Solution
Just noticed the first column formula needs to be different, so:

tally.xlsb
ABCDEFGHIJKLMNOP
1Name2021-112021-122022-012022-022022-032022-04Name2021-112021-122022-012022-022022-032022-04
2Harper21Harper   First  
3Evelyn157Evelyn  First   
4Ben81721Ben  First   
5
6Name2021-112021-122022-012022-022022-032022-04
7Harper   First  
8Evelyn  First   
9Ben  First   
10
Sheet3
Cell Formulas
RangeFormula
J2:J4J2=IF(B2<>"","First","")
K2:O4K2=IF(AND(SUM($B2:B2)=0,C2<>""),"First","")
B7:B9B7=IF(B2<>"","First","")
C7:G9C7=IF(AND(COUNTA($B2:B2)=0,C2<>""),"First","")
 
Upvote 0
If you want, there should be no need to have different formulas - assuming numerical values in the rows as per your sample.

22 05 07.xlsm
ABCDEFGHIJKLMNO
1Name2021-112021-122022-012022-022022-032022-04Name2021-112021-122022-012022-022022-032022-04
2Harper21Harper   First  
3Evelyn157Evelyn  First   
4Ben81721Ben  First   
5AnnAnn      
6Tom543TomFirst     
First
Cell Formulas
RangeFormula
J2:O6J2=IF(AND(COUNT($B2:B2)=1,COUNTIF($I2:I2,"?*")=1),"First","")
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,279
Members
449,075
Latest member
staticfluids

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