Formula help

onewingdove

New Member
Joined
Jan 31, 2025
Messages
1
Office Version
  1. 365
Platform
  1. Windows
I attached a small clip of the cells I'm working with.

Ignoring the spacing between columns, let's call them Column A, Column B and Column C

What I'm trying to do is if:

Column A has a date, then Column C = Column A+7 days
Column A is blank, but Column B has a date, then Column C = Column B+7 days
If both Column A and Column B are blank, the Column C = blank

Closest I've been able to get:
=IF(ISBLANK(A1), B1+7, A1+7)

However, this does not account for BOTH being blank, which is what I'm trying to figure out.

There does not need to be a calculation if both Column A and Column B have dates, as only Column A or Column B are filled and never both
 

Attachments

  • spreadsheet.png
    spreadsheet.png
    2.8 KB · Views: 7

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Welcome to the MrExcel board!

From your description columns A & B will never both have a date on the same row. If that is so, then try something like this
Excel Formula:
=IF(A2&B2="","",SUM(A2:B2)+7)

Edit: I have just looked more closely at your sample data & suspect that your dates are not real dates (numbers) but text values. Excel dates only start at 1900.
If you point this formula at one of your date cells, what does it return?
Excel Formula:
=ISNUMBER(A2)
 
Upvote 0
Assuming dates are text and could be before 1900, see if this works for you.

25 02 01.xlsm
ABC
1
21/20/18991/27/1899
3 
42/10/18992/17/1899
512/28/18651/4/1866
63/30/19844/6/1984
Dates
Cell Formulas
RangeFormula
C2:C6C2=LET(mdy,TEXTSPLIT(A2&B2,"/"),yr,TAKE(mdy,,-1),t,DATE(yr+2000,INDEX(mdy,1),INDEX(mdy,2))+7,IFERROR(TEXT(t,"m/d/")&yr+(YEAR(t)-2000-yr>0),""))
 
Upvote 0
Try it.
Excel Formula:
=IF(ISBLANK(A1), IF(ISBLANK(B1),"",B1+7), A1+7)
 
Upvote 0
I didn't assume dates are text and could be before 1900,
4 out 5 of their examples are dates before 1900 and therefore must be text. Given that sample data I would be very surprised if all of their data consisted of dates after 1900.

My question was simply did you try your formula with their sample data. ;)
 
Upvote 0
4 out 5 of their examples are dates before 1900 and therefore must be text. Given that sample data I would be very surprised if all of their data consisted of dates after 1900.

My question was simply did you try your formula with their sample data. ;)
You're right.
By the way, why you add "(YEAR(t)-2000-yr>0)" in your formula ?

And, why not "index(mdy, 3)" instead of "TAKE(mdy,,-1)" ?

Thank you
 
Upvote 0
why you add "(YEAR(t)-2000-yr>0)" in your formula ?
So that I still got the correct year if adding 7 days put the date into the next year like in row 5 of my mini sheet.


why not "index(mdy, 3)" instead of "TAKE(mdy,,-1)"
No particular reason. It is just what came into my head at the time.
 
Upvote 0
So that I still got the correct year if adding 7 days put the date into the next year like in row 5 of my mini sheet.



No particular reason. It is just what came into my head at the time.
You are so great.
I didn't consider the possible of the next year.
Your answers are always well thought out and without any logical flaws.
Thanks for your reply.
 
Upvote 0

Forum statistics

Threads
1,226,113
Messages
6,189,045
Members
453,521
Latest member
Chris_Hed

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