Consecutive Cell Formula

MIHeartandSoul

New Member
Joined
May 15, 2015
Messages
5
I am looking for assistance please. I am trying to count the number of 0's before there is a 1. Please see below...

StoreABCDEFGHIJKSum
1001010001101
2010100010101
3001100111002
4011000000008
5111111110010

<colgroup><col><col span="12"></colgroup><tbody>
</tbody>


So with my example above store #1 has 1 '0' (column K) before there is a '1'.
Store #4 Has 8 '0's before there is a '1'.

Can anyone suggest a formula on how to do this calculation?
 

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.
Your labeling is a little confusing... you seem to indicate your values are in Columns A:K, but that would mean the Store column would not exist? So I'll give you two formula for the two different possibilities and you pick the one that matches your actual setup.


Store in Column A, Data in Columns B:L
-------------------------------------------------------------------
=12-MAX((A2:L2=1)*COLUMN(A2:L2))


No Store column, data in Columns A:K
-------------------------------------------------------------------
=11-MAX((A2:K2=1)*COLUMN(A2:K2))


Note: Commit these formulas using CTRL+SHIFT+ENTER and not just Enter by itself
 
Upvote 0
Thank you so much for the fast reply. I am doing CTRL+SHIFT+ENTER and then pasting in the formula and I keep receiving: #value!. Any suggestions?

Your labeling is a little confusing... you seem to indicate your values are in Columns A:K, but that would mean the Store column would not exist? So I'll give you two formula for the two different possibilities and you pick the one that matches your actual setup.


Store in Column A, Data in Columns B:L
-------------------------------------------------------------------
=12-MAX((A2:L2=1)*COLUMN(A2:L2))


No Store column, data in Columns A:K
-------------------------------------------------------------------
=11-MAX((A2:K2=1)*COLUMN(A2:K2))


Note: Commit these formulas using CTRL+SHIFT+ENTER and not just Enter by itself
 
Upvote 0

Forum statistics

Threads
1,215,460
Messages
6,124,949
Members
449,198
Latest member
MhammadishaqKhan

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