Count number of days =SUM(History[Evaluation...

Count number of days

=SUM(History[Evaluation])/NUMBER(DATE(TODAY())-DATE(โ€œ1/7/2019โ€))

SUM(History[Evaluation])=141 NUMBER(DATE(TODAY())-DATE(โ€œ1/7/2019โ€))=0 I want to get โ€˜29โ€™ as counting the days from 1/7/2019 but it keeps giving me โ€˜0โ€™

How can I get โ€˜29โ€™?

0 2 404
2 REPLIES 2

Subtracting one date from another (e.g., DATE(TODAY())-DATE(โ€œ1/7/2019โ€) produces a Duration value, of the form HH:MM:SS (very similar toโ€“but not!โ€“a Time value). You then need to convert that into a number of days:

NUMBER(HOUR(DATE(TODAY())-DATE(โ€œ1/7/2019โ€)) / 24)

That should get you what you need.

Note, too, that you donโ€™t need NUMBER() (the result will already be a number), DATE() around TODAY() (itโ€™s already a date), or DATE() around โ€œ1/7/2019โ€ (itโ€™ll be recognized as a date automatically).

=SUM(History[Evaluation]) / (HOUR(TODAY() - โ€œ1/7/2019โ€) / 24)

It works perfectly! I will keep that in mind the number 24!! Thanks!

Top Labels in this Space