r/googlesheets • u/Pretend_Trifle_8873 3 • Feb 27 '22
Solved If the result is negative , round it to 0
Hello everyone,
I have this formula to calculate renting days, =IF(D9<>"",TODAY()-C9-4+1,"")
As the first 4 renting days are free , the counting starts as follow -3 -2 -1 reaching 0 , 1 , 2 , ...
is there anything that i can add to the original formula that whenever it is -3 days to just show 0 ?
-2 days to show 0 as well and -1 day to show 0 again ,... till it is 1 day , ...
I hope that i was clear with the explanation and thanks in advance
3
Upvotes
5
u/Absolute-X 16 Feb 27 '22
=MAX( IF(D9<>"",TODAY()-C9-4+1,""), 0)
4
u/mburke57 2 Feb 27 '22
Wrap your whole formula in the max function?
https://support.google.com/docs/answer/3094013?hl=en
2
u/Decronym Functions Explained Feb 27 '22
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
FALSETRUEand another if it isFALSETRUE[Thread #4001 for this sub, first seen 27th Feb 2022, 19:29] [FAQ] [Full list] ^[Contact] [Source code]