![]() This will also help you keep track of how many “)” you need at the end of the formula.Expert Tip: Before you begin, pre-format the cell that will hold your first formula in a number format. So start with your first IF statement, make sure it works, then add your next. My advice if you’re building this is to add one condition at a time. If(prop("Timeframe") = "6 months out", dateSubtract(prop("Wedding Date"), 6, "months"), if(prop("Timeframe") = "5 months out", dateSubtract(prop("Wedding Date"), 5, "months"), if(prop("Timeframe") = "4 months out", dateSubtract(prop("Wedding Date"), 4, "months"), if(prop("Timeframe") = "3 months out", dateSubtract(prop("Wedding Date"), 3, "months"), if(prop("Timeframe") = "2 months out", dateSubtract(prop("Wedding Date"), 2, "months"), if(prop("Timeframe") = "1 month out", dateSubtract(prop("Wedding Date"), 1, "months"), if(prop("Timeframe") = "2 Weeks Before", dateSubtract(prop("Wedding Date"), 2, "weeks"), if(prop("Timeframe") = "1 Week Before", dateSubtract(prop("Wedding Date"), 1, "weeks"), if(prop("Timeframe") = "Day Before", dateSubtract(prop("Wedding Date"), 1, "days"), if(prop("Timeframe") = "After The Wedding", dateAdd(prop("Wedding Date"), 2, "weeks"), fromTimestamp(toNumber("")))))))))))) “Timeframe” property - dropdown property, 10 options (as above) If(prop(“DropdownProperty”) = “6 months out”, dateSubtract(prop(“DateProperty”), 6, “months”), fromTimestamp(toNumber(“”)))Īltogether I had 10 different timeframe dropdown: 6 months out, 5 months out, 4 months out, 3 months out, 2 months out, 1 month out, 2 weeks before, 1 week before, day before, after the wedding. So the basic formula (1 option) would be: Using fromTimestamp(toNumber(“”)) returns a blank value in date format. Both of these outcomes need to be in a date format. Okay so, the reason the formula didn’t work in the first instance is because the IF statement needs 2 outcomes (value if true, value if false). I usually build my If formulas in stages, but I can't resolve the first if.įound it! (After all this work I ended up archiving this database and doing something completely different!) If (prop("Timeframe") does not equal any of the above, return "" (blank). ![]() If (prop("Timeframe") = "Day Before", return dateSubtract(prop("Wedding Date"), 1, "days").If (prop("Timeframe") = "Week Before", return dateSubtract(prop("Wedding Date"), 1, "weeks").If (prop("Timeframe") = "1 months out", return dateSubtract(prop("Wedding Date"), 1, "months").If (prop("Timeframe") = "2 months out", return dateSubtract(prop("Wedding Date"), 2, "months").If (prop("Timeframe") = "3 months out", return dateSubtract(prop("Wedding Date"), 3, "months"). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |