# Re: Format dates inside a add-date & IF formula

Solved
1272 0
cancel
Showing results for
Did you mean:
4 - Data Explorer

Hello,

For my plant tracker I’ve been using a formula to give me an estimated date of transplanting. This has been working fine. Now I want to add a check-box, so that when I plant something in-ground and i check this, the Estimated date of transplanting box will return an N/A vallue. I got all of this to work but I have a problem with how to date is formatted.

As you can see the last column has a different date format. This is the code:

IF({In-ground} = 1, “N/A”, IF({Germination Date}, DATEADD({Germination Date},{Estimated days to Transplanting}+0,‘days’),IF({Estimated germination date}, DATEADD({Estimated germination date},{Estimated days to Transplanting}+0,‘days’))))

I tried to add a BLANK() after the DATEADD so I can change it in the formatting tab but it doesn’t work. I think I have to add a DATETIME_FORMAT but i’m not sure where to add it in this formula.

1 Solution

Accepted Solutions
18 - Pluto

I think you’ll need to wrap all the dates in your formula with `DATETIME_FORMAT` like you said, resulting in something like this:

`IF({In-ground} = 1, "N/A", IF({Germination Date}, DATETIME_FORMAT(DATEADD({Germination Date},{Estimated days to Transplanting}+0,"days"), "LL"),IF({Estimated germination date}, DATETIME_FORMAT(DATEADD({Estimated germination date},{Estimated days to Transplanting}+0,"days"), "LL"))))`

Can’t be sure this formula will work as I can’t test it easily; feel free to DM me a creator link to your base and I can just do it for you if you’d like

2 Replies 2
18 - Pluto

I think you’ll need to wrap all the dates in your formula with `DATETIME_FORMAT` like you said, resulting in something like this:

`IF({In-ground} = 1, "N/A", IF({Germination Date}, DATETIME_FORMAT(DATEADD({Germination Date},{Estimated days to Transplanting}+0,"days"), "LL"),IF({Estimated germination date}, DATETIME_FORMAT(DATEADD({Estimated germination date},{Estimated days to Transplanting}+0,"days"), "LL"))))`

Can’t be sure this formula will work as I can’t test it easily; feel free to DM me a creator link to your base and I can just do it for you if you’d like

4 - Data Explorer

Thank you! It worked.