Counting, but make it immutable

In Calc, I want a counter to increment if today is a Tuesday, but I don’t want an IF statement to cause it to revert to zero when it’s no longer Tuesday. So the counter goes up by 1 if today is Tuesday, but doesn’t go back down to it’s former value when the Tueday condition is no longer met (for another six days).

Do I understand right: You want a counter which shows 0 until first Tuesday, then show 1 until next Tuesday, then show 2 for another week, 3 for the next week and increment on each Tuesday?. If that understanding is true, at least you need to specify a starting date (i.e, the date (!!!) of the first Tuesday to show 1.

Sorry to have waited so long to respond, but yes, that’s it.

Hello,

a solution assuming the first Tuesday of this year 2020 (i.e 2020-01-07 should show 1 could look like this:

=IF((TODAY()<VALUE("2020-01-07")); 0; INT((TODAY()-VALUE("2020-01-07"))/7)+1)

to have a counter ( = number of of weeks), which increments every Tuesday. You may easily adapt to any other starting point by changing the date of the first Tuesday to be 1

Tested using LibreOffice:

Version: 6.4.0.3, Build ID: b0a288ab3d2d4774cb44b62f04d5d28733ac6df8
CPU threads: 8; OS: Linux 4.12; UI render: default; VCL: kf5; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US, Calc: threaded

Hope that helps.

If the answer helped to solve your problem, please click the check mark (:heavy_check_mark:) next to the answer.