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

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
another way

[Table="width:, class:head"][tr=bgcolor:#000000][th] [/th][th]
A
[/th][th]
B
[/th][th]
C
[/th][th]
D
[/th][/tr]
[tr=bgcolor:#FFFFFF][td=bgcolor:#000000]
1
[/td][td]StartDate[/td][td]EndDate[/td][td]Age[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#000000]
2
[/td][td]
10/07/2019​
[/td][td]
20/07/2019​
[/td][td]
10​
[/td][td]=IFERROR(CHOOSE(MATCH(--ISBLANK(B2),{0,1},0),DATEDIF(A2,B2,"d"),DATEDIF(A2,TODAY(),"d")),"")[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#000000]
3
[/td][td]
20/07/2019​
[/td][td]
30/07/2019​
[/td][td]
10​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#000000]
4
[/td][td]
30/07/2019​
[/td][td]
10/08/2019​
[/td][td]
11​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#000000]
5
[/td][td]
10/08/2019​
[/td][td][/td][td]
5​
[/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#000000]
6
[/td][td]
20/08/2019​
[/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#000000]
7
[/td][td]
30/08/2019​
[/td][td][/td][td][/td][td][/td][/tr]
[/table]
 
Upvote 0

Forum statistics

Threads
1,224,749
Messages
6,180,730
Members
452,995
Latest member
isldboy

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