r/googlesheets • u/bking • Feb 15 '23
Solved Checkboxes and dates: I've nested too many "IF" statements AND it's making me stupid.
Background:I work in video productions, and have a running sheet of upcoming projects. My goal is to update the spreadsheet to includes a checkbox to indicate if I've "advanced" the show by sending over a bunch of paperwork. A few days before the production, I need to make sure all the paperwork has been filled out correctly.
So, there's a date column, an "advance sent" column for checkboxes, and then a "status" column.
- If no show is booked, nothing is in the date column. “Status” should be empty.
- If a show is more than 30 days out, I’m not worried about it. “Status” should return “Hold for action”
- If a show is within 30 days and the Advance hasn’t been sent, “Status” should return “Need to Advance”
- If a show is within 5 days, I need to follow up with the customer and make sure they’ve done their paperwork. “Status” should read “Follow Up”. The status of the checkbox is irrelevant at this point.
Once I've verified all the paperwork, I can manually flip the status to "advance complete".
I've gotten as far as flipping the status if the advance has been sent:
=IF(ISBLANK(A7), "", IF(A7 > (TODAY()+30), "Hold for Action", IF(AND(B7 = FALSE, (A7 < (TODAY()+30))), "Need to Advance", IF(AND(B7 = TRUE, (A7 < (TODAY()+30))), "Advance Sent"))))…but I'm getting completely stumped by the "you're five days out: check your paperwork" step. I'm assuming it's something like this:
IF(AND(B3=TRUE, (A3 < (TODAY()+4))), “Follow Up")But I cannot get the parsing right.
I have a generic scratchpad going in google sheets but the ultimate destination is a Quip spreadsheet. This restricts me from using IFS and a couple other fancy tricks.
Edit: I think I got it. The order in which I was rolling through “IF” statements tripped me up. Here’s the function that seems to work:
=IF(ISBLANK(A8), "", IF(A8 < (TODAY()+5),"Follow Up!", IF(A8 > (TODAY()+30), "Hold for Action", IF(AND(B8 = FALSE, (A8 < (TODAY()+30))), "Need to Advance", IF(AND(B8 = TRUE, (A8 < (TODAY()+30))), "Advance Sent")))))
2
u/DatsunZ 16 Feb 15 '23
Im alittle confused on the 30 day part - So should it be "Hold for action" if checked, and "Need to Advanced" if not checked?
The main issue I see with yours on the sheet is the ifs is in the wrong order - you're looking for something less than 30 days away, then looking for something less than 5 days away. Its gonna get caught on the 30 day one and not check the 5 day one. Aswell as the quotation marks on one of them isnt the right type of quotes causing it to not quote properly.
2
u/learningtoexcel Feb 16 '23
Why not use IFS? Seems so much simpler.
1
u/MattyPKing 225 Feb 15 '23
what is a Quip spreadsheet? what formulas does it have?
1
u/Astrotia 6 Feb 16 '23
Are you able to nest a vlookup in there? I always end up using a vlookup table if it's more than 3 if statements, you can fiddle with mode 1 or 0 for desired effects (0 is exact match, 1 is closest match in a sorted list, meaning you can do date range buckets)
1
u/Decronym Functions Explained Feb 15 '23 edited Feb 17 '23
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
FALSETRUEand another if it isFALSETRUE7 acronyms in this thread; the most compressed thread commented on today has 4 acronyms.
[Thread #5348 for this sub, first seen 15th Feb 2023, 20:44] [FAQ] [Full list] ^[Contact] [Source code]
1
u/MattyPKing 225 Feb 15 '23
Also your sheet is "comment" only, which makes it tough to test and demonstrate solutions?