Can't get this formula to work

pboltonchina

Well-known Member
Joined
Apr 24, 2008
Messages
1,117
Hi Everyone, not been here for a long time but I need a bit of formula help please. I'm trying to look at 2 cells that have dates in them that calculate the number of days between those dates. If you just do a date formula it doesn't include both dates and returns 1 less than the actual count. However if the second cell is empty I don't want anything to show in the resultant cell until the second date is entered.
Here's what I am trying with

=IF((G2="",""),DAYS(G2,F2)+1
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
You've got a bracket in the wrong place:

Excel Formula:
=IF(G2="","",DAYS(G2,F2)+1)
 
Last edited:
Upvote 0
This doesn't work. I notice you have 3 opening brackets and 2 closing brackets, does this make a difference
 
Upvote 0
I believe it should be:
Excel Formula:
=IF(G2="","",DAYS(G2,F2)+1)
 
Upvote 0
Solution
Yes, sorry - I missed that you had the extra opening bracket in your original. I have removed it now.
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,678
Members
452,937
Latest member
Bhg1984

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