iferror and today function

%3CLINGO-SUB%20id%3D%22lingo-sub-2818113%22%20slang%3D%22en-US%22%3Eiferror%20and%20today%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2818113%22%20slang%3D%22en-US%22%3EHi%2C%20I'm%20trying%20to%20use%20both%20functional%20ions%20to%20calculate%20duration%20in%20a%20project%20tracker.%20My%20formula%20is%3A%3CBR%20%2F%3E%3Diferror(cell%20b-a%2Ctoday()-cell%20a)%3CBR%20%2F%3EReason%20it's%20done%20this%20way%20is%20because%20i%20would%20like%20a%20count%20of%20the%20days%20if%20there%20is%20no%20completion%20date%20and%20will%20calculate%20from%20today's%20date%20minus%20the%20start%20date.%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2818113%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2818249%22%20slang%3D%22en-US%22%3ERe%3A%20iferror%20and%20today%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2818249%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1177281%22%20target%3D%22_blank%22%3E%40Lizzy2320%3C%2FA%3E%26nbsp%3BPerhaps%20something%20like%20this%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3DIF(ISBLANK(B1)%2CTODAY()-A1%2CB1-A1)%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EUsing%20IFERROR%20makes%20no%20sense%20as%20there%20will%20not%20be%20an%20error.%20Just%20a%20TRUE%20or%20a%20FALSE.%20This%20formula%20will%20check%20if%20B%20is%20empty.%20If%20so%2C%20todays%20date%2C%20minus%20A%2C%20otherwise%20B%20minus%20A.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2818372%22%20slang%3D%22en-US%22%3ERe%3A%20iferror%20and%20today%20function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2818372%22%20slang%3D%22en-US%22%3EThanks!%20Isblank%20won't%20count%20accurately%20if%20the%20end%20date%20is%20inputted.%3C%2FLINGO-BODY%3E
New Contributor
Hi, I'm trying to use both functional ions to calculate duration in a project tracker. My formula is:
=iferror(cell b-a,today()-cell a)
Reason it's done this way is because i would like a count of the days if there is no completion date and will calculate from today's date minus the start date.
6 Replies

@Lizzy2320 Perhaps something like this:

=IF(ISBLANK(B1),TODAY()-A1,B1-A1)

Using IFERROR makes no sense as there will not be an error. Just a TRUE or a FALSE. This formula will check if B is empty. If so, todays date, minus A, otherwise B minus A. 

Thanks! Isblank won't count accurately if the end date is inputted.

@Lizzy2320 Why not? See attached.

 

If the cells are blank it will return a number.

@Lizzy2320 Perhaps like this then:

=IF(ISBLANK(A1),"",IF(ISBLANK(B1),TODAY()-A1,B1-A1))

 

Thank you! This did the trick