Calculate work order aging with IF statement for blanks.

Ybenn

New Member
Joined
Aug 14, 2019
Messages
2
Hello.

I need to calculate the age of a work order using the start date (a2) and end date (b2). The “open” work orders will have a blank end date.

I want to write a formula that will use today’s date as the end date if the end date cell is blank. I’m assuming I use an IF statement, but not sure how to write it.
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
another way

A
B
C
D
1
StartDateEndDateAge
2
10/07/2019​
20/07/2019​
10​
=IFERROR(CHOOSE(MATCH(--ISBLANK(B2),{0,1},0),DATEDIF(A2,B2,"d"),DATEDIF(A2,TODAY(),"d")),"")
3
20/07/2019​
30/07/2019​
10​
4
30/07/2019​
10/08/2019​
11​
5
10/08/2019​
5​
6
20/08/2019​
7
30/08/2019​
 
Upvote 0

Forum statistics

Threads
1,215,781
Messages
6,126,870
Members
449,345
Latest member
CharlieDP

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top