How many cells are 0 till first cell is >1

Joined
Mar 8, 2024
Messages
4
Office Version
  1. 365
Platform
  1. Windows
1709901427256.png
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Hi & welcome to MrExcel.

How about
Excel Formula:
=IFERROR(MIN(FILTER(SEQUENCE(,12),M2:X2>0)),1)

Also in future please write your post using normal text, rather than posting an image with massive text.
 
Upvote 0
count of content "0" from left to right (M:X) + 1
So if ..
the first row should be 4 because there are 3 zeros before the first non-zero value (3+1) and
the third row should be 1 because there are 0 zeros before the first non-zero value (0+1)
.. then I don't understand why the second row should be 12 since that should mean there are 11 zeros before the first non-zero value (11+1) but that is not the case since there is already 12 zeros in the row. :confused:

However, if 12 really is the value you want in that situation you could try
Excel Formula:
=IFNA(XMATCH(TRUE,M2:X2>0),12)

or if the number of columns might change a more general version would be
Excel Formula:
=IFNA(XMATCH(TRUE,M2:X2>0),COLUMNS(M2:X2))
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0
It appears to me that their reply was directed to Fluff:
Yes, I thought that too, but since @Fluff's formula does not produce the expected result for one of the sample data rows I was pressing the point.
 
Upvote 0
someone was to optimistic in his reaction.....
colleague responded without any check, unfortunately I am still without a working formula
 
Upvote 0

Forum statistics

Threads
1,221,877
Messages
6,162,579
Members
451,776
Latest member
bosvinn

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