How do I create an appsheet formula that the same thing as what this excel formula does, where cell F5 is equivalent to [Sowing Date] column & H5 is equivalent to [Planting Date] column
TEXT(INT(DATEDIF(F5,H5,"d")/7),"00")&" weeks & "&TEXT(MOD(DATEDIF(F5,H5,"d"),7),"00")&" days ("&TEXT(DATEDIF(F5,H5,"d"),"00")&" days total)"
Below is an example of how a result would look like
05 weeks & 05 days (40 days total)
Solved! Go to Solution.
Please try
CONCATENATE(
RIGHT("00"&(FLOOR(HOUR([Planting Date]-[Sowing Date])/168)), 2), " weeks & ",
RIGHT("00"&(MOD(HOUR([Planting Date]-[Sowing Date])/24,7)),2), " days ",
"(", HOUR([Planting Date]-[Sowing Date])/24, " days total)"
)
Please try
CONCATENATE(FLOOR(HOUR([Planting Date]-[Sowing Date])/168), " weeks & ", MOD(HOUR([Planting Date]-[Sowing Date])/24,7), " days ", "(", HOUR([Planting Date]-[Sowing Date])/24, " days total)")
Thanks for the support @Suvrutt_Gurjar That did help
Is there a way however that the formula can be modified to have the leading zero.
05 weeks & 05 days (40 days total)
I thought this would work but I get the following error message.
"TEXT function with two arguments requires a temporal type and text representing a date format"
CONCATENATE
(
TEXT(FLOOR(HOUR([Planting Date]-[Sowing Date])/168),"00"),
" weeks & ",
TEXT(MOD(HOUR([Planting Date]-[Sowing Date])/24,7),"00"),
" days ",
"(",
HOUR([Planting Date]-[Sowing Date])/24,
" days total)"
)
Please try
CONCATENATE(
RIGHT("00"&(FLOOR(HOUR([Planting Date]-[Sowing Date])/168)), 2), " weeks & ",
RIGHT("00"&(MOD(HOUR([Planting Date]-[Sowing Date])/24,7)),2), " days ",
"(", HOUR([Planting Date]-[Sowing Date])/24, " days total)"
)
You are welcome. Good to know the expression works per your requirement.
How many weeks in 40 day milu
User | Count |
---|---|
17 | |
14 | |
10 | |
7 | |
4 |