calculation from date

Hello Guys!

Hope all of you are doing fine.

I am facing issue regarding calculation. I have two date fields SemEnd and SemStart.  I have two date values in the columns as follows- 

Start Date

2/28/2022
 
End Date
6/10/2022
 
Then I want to use the following calculation to get the number of weeks for a virtual columns.

ROUND((HOUR([SemEnd]-[SemStart])/24)/7)

If I calculate manually in calculator it will be 14.57 before rounding as the calculated number of days is 102. But appsheet gives 14. It should be 15 after rounding. Therefore, please extend your precious help to shoot the problem.

Thanks.

0 8 137
8 REPLIES 8

HOUR gives an hour (00:00 -> 23:59), not the duration (hours), TOTALHOURS() is for that.

[SemEnd]-[SemStart] should already give a number of days, just divide that by 7 and round, no need for HOUR() nor /24

I found my solution as below that gave me the correct calculation-

ROUND (TOTALHOURS([SemEnd]-[SemStart])/(24*7))

I can not understand Appsheet designers' psychology.

Anyway, Thanks a lot for your kind help. However, if you have any other suggestion, please post it. 

Thanks again.

Or please try with

ROUND((HOUR([SemEnd]-[SemStart])/24)/7.00)

I used it but didn't use 7.00. Instead used 7 that didn't work. 

Thanks a lot @SkrOYC .

But What I found it gives duration not number of days. It gives 2448:00:00, which is hour. So far I found.

I used it but used 24 instead 24.00 that didn't work. 

Thanks 

This would work as well:

ROUND((HOUR([SemEnd]-[SemStart])/24.00)/7)

Top Labels in this Space