Subtract a date from a Date and get remaining Days

Softwarez

Board Regular
Joined
Oct 21, 2005
Messages
57
How can i subtract a date form a date in excel?

Not VBA code, just normal excel please :)!

Heres my scnario.. (what i thought i could do)

I had a cell with =Today() 'Gives todays date

then a cell with a "Due Date" A day my assignment is due.

So i then wanted to get how many days till the assignment was due.

So i thought..

Say due date was E3
and =Today() was F3

=SUM(E3-F3)

but i get #VALUE!


any ideas? thanks.
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
I just tried what you have stated and if I format the result cell as number it works as expected. IE subtrating Due date from start date shows number of days.
 
Upvote 0
If you get a #VALUE! error that probably means that either E3 or F3 is being interpreted as text.

does

=E3-today() work?
 
Upvote 0
When you get it to work, remember to add 1 day.

i.e today()-today() = 0, your desired result should be 1
 
Upvote 0
Ah i found out why.. i have a calendar on ym userform which puts the date in a textbox which then puts it to the sheet.. however... it puts a space infront of the date making it invalid!! how can i get ri dof the space? =/ it seems to put it there standard
 
Upvote 0
Softwarez said:
Ah i found out why.. i have a calendar on ym userform which puts the date in a textbox which then puts it to the sheet.. however... it puts a space infront of the date making it invalid!! how can i get ri dof the space? =/ it seems to put it there standard

You can use

=N(E3) or =--E3

to return the numeric value

EDIT but you should edit the code and prevent the problem from happening.
 
Upvote 0

Forum statistics

Threads
1,203,171
Messages
6,053,875
Members
444,692
Latest member
Queendom

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