If AND Formula

jo.stanley

Board Regular
Joined
Apr 13, 2004
Messages
177
I need to calculate the following. can anyone please assist?

If F1 = Value then F1-D1 or if E1= Value then E1-D1. If F1 or E1 are blank than cell to remain empty
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
I'm afraid this is not clear and you're not showing a picture of your spreadsheet that's in front of you. Please state:

The cell the formula needs to be in
What is in D1, E1 and F1?
What is the "value" and what cell is the "value" in?

At a guess, you can adjust:
Code:
=IF(LEN(F1)*LEN(E1)=0,"",-D1+IF(F1=value,F1,IF(E1=value,E1,0)))
 
Upvote 0
Hi

Sorry its not clear. Im afraid I cant show a pic so ill try and explain clearer

Column D always has a date in it
Column E and F sometimes have a date in either one but not in both

What I want to calculate is the number of days that has elapsed between the two dates but if there is only a date in Column D then the cell will remain blank. The formula I am currently using is =IF(ISBLANK(F4)=FALSE,(F4-D4),(E4-D4))

But it is returning a large negative value E and F are blank
 
Upvote 0
Try:
Code:
=IF(LEN(E4)*LEN(F4)=0,"",MAX(F4-D4,E4-D4))
 
Upvote 0
Try:
Code:
=IF(LEN(E4)+LEN(F4)=0,"",MAX(F4,E4)-D4)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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