Formula to count number of zeros before a value to the left

Stuart Little

Board Regular
Joined
Mar 4, 2002
Messages
64
Hi All,

I am using the folliwng formula =MATCH(1,INDEX(--($C8:$M8>0),0),0)-1
but this only counts from the Left to Right, I would like a formaula that counts Right to Left.

The formula would always be in the same column say N for the example above.

Using the formula above it would bring back 2, i need the answer to be 5

Row
abcdefghijklm
00123400000

I have thought about an offfset formula but cannot get it to work.

All help appreciated.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi Stuart,

This is not the best solution I suppose, but so far can't figure out how to do this with other formula. If will get something better before some one else would, then I will post it as well.

this formula will check last 10 digits.

Code:
=IF(INDEX($A2:$K2,1,COUNT($A2:$K2))<>0,0,IF(INDEX($A2:$K2,1,COUNT($A2:$K2)-1)<>0,1,IF(INDEX($A2:$K2,1,COUNT($A2:$K2)-2)<>0,2,IF(INDEX($A2:$K2,1,COUNT($A2:$K2)-3)<>0,3,IF(INDEX($A2:$K2,1,COUNT($A2:$K2)-4)<>0,4,IF(INDEX($A2:$K2,1,COUNT($A2:$K2)-5)<>0,5,IF(INDEX($A2:$K2,1,COUNT($A2:$K2)-6)<>0,6,IF(INDEX($A2:$K2,1,COUNT($A2:$K2)-7)<>0,7,IF(INDEX($A2:$K2,1,COUNT($A2:$K2)-8)<>0,8,IF(INDEX($A2:$K2,1,COUNT($A2:$K2)-9)<>0,9,IF(INDEX($A2:$K2,1,COUNT($A2:$K2)-10)<>0,10)))))))))))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,221,526
Messages
6,160,340
Members
451,637
Latest member
hvp2262

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