Reset a Counter to zero and continue to count when a specific number is detected.

DarkestValkryie

New Member
Joined
Jun 12, 2018
Messages
5
I am looking for a little help here. I'm not a novice, but I am not an expert either. Just need to resolve one issue. I will include as much info as I can during my explanation.

I am trying to make a "days since" tracker that shows the days since someone has delivered a certain thing. (not using dates just week numbers) like displayed in the table below;
Store NameRegion123456789101112Store TotalAnnual TotalDays Since Last Appr
ErdingtonDC10000111 133 0
Leamington SpaDC10000100 033 21
Coventry AlvisDC1000011103
3 7

<tbody>
</tbody>


I have already worked out how to get the <1 to return as 7 and (=>)1 to return as 0 as well as not recognising a blank cell as anything, I just need to find a way to reset the counter every time (=>)1 is detected.

My formula so far is this (be warned its long)

=IF(ISBLANK(D6),0,IF(D6<1,7,0))+IF(ISBLANK(E6),0,IF(E6<1,7,0))+IF(ISBLANK(F6),0,IF(F6<1,7,0))+IF(ISBLANK(G6),0,IF(G6<1,7,0))+IF(ISBLANK(H6),0,IF(H6<1,7,0))+IF(ISBLANK(I6),0,IF(I6<1,7,0))+IF(ISBLANK(J6),0,IF(J6<1,7,0))+IF(ISBLANK(K6),0,IF(K6<1,7,0))+IF(ISBLANK(L6),0,IF(L6<1,7,0))+IF(ISBLANK(M6),0,IF(M6<1,7,0))+IF(ISBLANK(N6),0,IF(N6<1,7,0))+IF(ISBLANK(O6),0,IF(O6<1,7,0))

This is per cell in the total Column and relates to that row number.

I just need to add the reset count feature to it. Macros are enabled so if I need to insert code that is not going to be a problem I just need it to work and to work in a single cell. I have a grid that does the count for me but that's no use to me. It has to be contained in 1 cell.

Many Thanks in advance.

EDIT:
Also, If I need to use the existing table that works it out across multiple cells as a base for the formula, in order to contain it in one cell then that is fine.
 
Last edited by a moderator:

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Try

Excel 2010
ABCDEFGHIJKLMNOPQ
1Store NameRegion123456789101112Store TotalAnnual TotalDays Since Last Appr
2ErdingtonDC100001111330
3Leamington SpaDC1000010003321
4Coventry AlvisDC100001110337
Sheet6
Cell Formulas
RangeFormula
Q2=IFERROR(COUNTIF(INDEX(A2:N2,LOOKUP(2,1/(C2:N2=1),COLUMN(C2:N2))):N2,0)*7,COUNTIF(C2:N2,0)*7)
Q3=IFERROR(COUNTIF(INDEX(A3:N3,LOOKUP(2,1/(C3:N3=1),COLUMN(C3:N3))):N3,0)*7,COUNTIF(C3:N3,0)*7)
Q4=IFERROR(COUNTIF(INDEX(A4:N4,LOOKUP(2,1/(C4:N4=1),COLUMN(C4:N4))):N4,0)*7,COUNTIF(C4:N4,0)*7)
 
Upvote 0
Scott you are an amazing individual. Thank you so much!! you have no idea how long I have been working on this sheet!!! You have my utmost gratitude. Thank you.
 
Upvote 0
New question, same topic. Say I have 4 sheets, one for each quarter, and I want the count from the previous sheet to follow onto the next sheet and then continue counting like before. What formula would I need to put in Q2 on Sheet2 in order to continue with the count whilst taking the previous sheets final result into account??
 
Upvote 0
Does this do what you want?


Excel 2010
ABCDEFGHIJKLMNOPQ
1Store NameRegion123456789101112Store TotalAnnual TotalDays Since Last Appr
2ErdingtonDC100001117330
3Leamington SpaDC1000020003321
4Coventry AlvisDC100001120337
Sheet6
Cell Formulas
RangeFormula
Q2=IFERROR(COUNTIF(INDEX(A2:N2,LOOKUP(2,1/(C2:N2>=1),COLUMN(C2:N2))):N2,0)*7,COUNTIF(C2:N2,0)*7)
Q3=IFERROR(COUNTIF(INDEX(A3:N3,LOOKUP(2,1/(C3:N3>=1),COLUMN(C3:N3))):N3,0)*7,COUNTIF(C3:N3,0)*7)
Q4=IFERROR(COUNTIF(INDEX(A4:N4,LOOKUP(2,1/(C4:N4>=1),COLUMN(C4:N4))):N4,0)*7,COUNTIF(C4:N4,0)*7)
 
Upvote 0
No this just returns 0 and doesn't count 0 as 7. Would probably be a better idea for it to detect between 1 and 5 as the reset point, rather than more than. Thank you for your help btw it is very much appreciated.
 
Upvote 0
Cross posted https://www.excelforum.com/excel-fo...t-counter-for-equal-to-and-more-than-0-a.html

Cross-Posting
While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,214,950
Messages
6,122,436
Members
449,083
Latest member
Ava19

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