Aging with if statement

dmxcasper2

Board Regular
Joined
Mar 21, 2012
Messages
65
Problem Statement:

For Row 2 I'm using =today()-A1
For Row 3 I need a a formula that perform the following logic statement under these conditions:


  • If Column B is blank then calculate using =today()-A1
  • If Column B has a date then calculate Column A - Column B
  • If Column A has a non date value like "TBA", then Column C should remain blank

Is it possible to keep Column values a positive integers.

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Column A[/TD]
[TD="align: center"]Column B[/TD]
[TD="align: center"]Column C - Aging[/TD]
[/TR]
[TR]
[TD="align: center"]11/05/2018[/TD]
[TD="align: center"]12/01/2018[/TD]
[TD="align: center"]26[/TD]
[/TR]
[TR]
[TD="align: center"]11/05/2018[/TD]
[TD="align: center"][/TD]
[TD="align: center"]30[/TD]
[/TR]
</tbody>[/TABLE]

 

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
The formula would be in Column. Example shown below: C2, C3 and on.

[TABLE="class: cms_table_grid, width: 500"]
<tbody>[TR]
[TD="align: center"]Column A[/TD]
[TD="align: center"]Column B[/TD]
[TD="align: center"]Column C - Aging[/TD]
[/TR]
[TR]
[TD="align: center"]11/05/2018[/TD]
[TD="align: center"]12/01/2018[/TD]
[TD="align: center"]26[/TD]
[/TR]
[TR]
[TD="align: center"]11/05/2018[/TD]
[TD="align: center"][/TD]
[TD="align: center"]30[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
or

=IF(OR(A2="",ISTEXT(A2)),"",IF(ISNUMBER(B2),A2-B2,TODAY()-A2))

Good point i should have included where there is no data in the A column if they plan to drag this down further than the data.

=IF(OR(ISTEXT(A1), A1=""),"",IF(ISBLANK(B1),TODAY()-A1,B1-A1))
 
Upvote 0
Hi,

This would also work:


Book1
ABC
111/5/201812/1/201826
211/5/201830
3
4TBA
Sheet378
Cell Formulas
RangeFormula
C1=IF(N(A1),IF(B1,B1,TODAY())-A1,"")


Formula copied down.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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