Need some help on a formula

watkins365

New Member
Joined
Jan 21, 2025
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Sorry, i am probably being a bit dense but cannot get a formula to work.
Column J is a blank in which user inserts a date
Column L is a blank in which user might insert a date
Column O is blank BUT needs a formula that is the date inserted in J plus 5 days but only if there is no date in L, if there is a date in L then column O must be L plus 5 days .

Been going around in circles on this !
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Is it possible to have a date in both column L and J and if so which date takes precedent if not then maybe

=IF(L2="",J2+5,L2+5)
 
Upvote 0
Welcome to the Board!

Try:
Excel Formula:
=IF(AND(J5="",L5=""),"",IF(L5>0,L5+5,J5+5))
 
Upvote 0
Solution
,
Is it possible to have a date in both column L and J and if so which date takes precedent if not then maybe

=IF(L2="",J2+5,L2+5)
many thanks, away from PC presently. Yes date in both possible. If their is a date in J then that takes precedent.
 
Upvote 0
Column O is blank BUT needs a formula that is the date inserted in J plus 5 days but only if there is no date in L, if there is a date in L then column O must be L plus 5 days .

Yes date in both possible. If their is a date in J then that takes precedent.

OK, that seems to contradict your original statement, in which it implies if there is a date in L, that would seem to take precedence.
You also did not mention if it is possible if both might be blank. I have the formula returning a blank if both J and L are blank.

If that is possible, and you want to return a blank, and J really does take precedence over L, you would just flip-flop the J and L references in the second IF statement, i.e.
Excel Formula:
=IF(AND(J5="",L5=""),"",IF(J5>0,J5+5,L5+5))
 
Upvote 0
OK, that seems to contradict your original statement, in which it implies if there is a date in L, that would seem to take precedence.
You also did not mention if it is possible if both might be blank. I have the formula returning a blank if both J and L are blank.

If that is possible, and you want to return a blank, and J really does take precedence over L, you would just flip-flop the J and L references in the second IF statement, i.e.
Excel Formula:
=IF(AND(J5="",L5=""),"",IF(J5>0,J5+5,L5+5))
My apologise, I was away from the spreadsheet when I answered. If there is a date in L then that is the date that will require 5 days to be added. I have flipped the J and L, tried the formula suggested and it works providing there is a date in both J and L, if there is only a date in J it is giving me a random 1900 year date
 
Upvote 0
Seems to work ok for me, any chance you could post a screenshot

1737540996111.png
 
Upvote 0
Seems to work ok for me, any chance you could post a screenshot

View attachment 121512
This is the formula as it stands ( I am On Row 6 rather than 5)
1737545244248.png

This is producing

It is resulting in this if only one date shown
1737545315129.png


But if L has a date it results in this, which is correct but need it to have a correct date in the above scenario as well.

1737545437915.png


I am sure its something I am doing so do forgive me ignorance!
 
Upvote 0
This is the formula as it stands ( I am On Row 6 rather than 5)
View attachment 121517
This is producing

It is resulting in this if only one date shown
View attachment 121518

But if L has a date it results in this, which is correct but need it to have a correct date in the above scenario as well.

View attachment 121520

I am sure its something I am doing so do forgive me ignorance!
You have not typed the formula I gave you in post 5 correctly!
Look again closely at the column references.
In the second IF, you are checking column J for a value, and if it has one, you are adding the values to column L! You have those last two column references switched!

I usually recommend NOT manually typing out the formula we give you, as that can lead to typos like this.
Just use copy and paste, and then you can simply change the row number in the formula.
 
Upvote 0
The formula is wrong (as in copied over incorrectly from what Joe provided), in the second IF

You have: =IF(AND(J5="",L5=""),"",IF(J5>0,L5+5,J5+5))

It needs to be: =IF(AND(J5="",L5=""),"",IF(J5>0,J5+5,L5+5))
 
Upvote 0

Forum statistics

Threads
1,226,079
Messages
6,188,771
Members
453,499
Latest member
samdan87153

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