Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-13-2017, 12:10 AM
otuatail otuatail is offline Date diff in excel 2007 Windows 7 64bit Date diff in excel 2007 Office 2007
Competent Performer
Date diff in excel 2007
 
Join Date: Jun 2012
Posts: 246
otuatail is on a distinguished road
Default Date diff in excel 2007

Hi I have 3 cells E1,F1,G11

I want to store cell IDs containing dates in E1 and F1. Cell G1 will show the number of days difference.

EG:

E1 = '06/04/2017 19:00:00'
F1 = '28/04/2017 19:00:00'
G1 = '22 Days'

I tried entering =DATEDIF(F1,E1,"D") into cell G1 but it doesn't work.
Reply With Quote
  #2  
Old 04-13-2017, 01:07 AM
xor xor is offline Date diff in excel 2007 Windows 10 Date diff in excel 2007 Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

Change to:

=DATEDIF(E1,F1,"D")
Reply With Quote
  #3  
Old 04-13-2017, 06:54 AM
otuatail otuatail is offline Date diff in excel 2007 Windows 7 64bit Date diff in excel 2007 Office 2007
Competent Performer
Date diff in excel 2007
 
Join Date: Jun 2012
Posts: 246
otuatail is on a distinguished road
Default

=DATEDIF(F1,E1,"D")
=DATEDIF(E1,F1,"D")

All you have done is reversed the 2 cells. This would give a negative value but it doesn't work.
Reply With Quote
  #4  
Old 04-13-2017, 06:58 AM
xor xor is offline Date diff in excel 2007 Windows 10 Date diff in excel 2007 Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

Have you actually tried?

What do you mean by "giving a negative value"?
Attached Files
File Type: xlsx Datedif.xlsx (13.8 KB, 7 views)
Reply With Quote
  #5  
Old 04-13-2017, 09:04 AM
otuatail otuatail is offline Date diff in excel 2007 Windows 7 64bit Date diff in excel 2007 Office 2007
Competent Performer
Date diff in excel 2007
 
Join Date: Jun 2012
Posts: 246
otuatail is on a distinguished road
Default

No you are missing the point.

Cell B2 has the date Value "25/03/2017 11:30:00"
Cell B8 has the date value "31/03/2017 12:00:00"

NOW
I am going to but into cell E2 the text value 'B2'
I am going to but into cell F2 the text value 'B8'

What I want to put into cell G2 is a calculation which requires it to LOOK at Cell E2 find the contents of that cell and look at as a pointer to the cell containing the date.

Cell E2 and F2 don't have a date value just the pointer to the cell that has the date. It is a reference/pointer
Reply With Quote
  #6  
Old 04-13-2017, 10:37 AM
xor xor is offline Date diff in excel 2007 Windows 10 Date diff in excel 2007 Office 2016
Expert
 
Join Date: Oct 2015
Posts: 1,097
xor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to allxor is a name known to all
Default

How about the attached?
Attached Files
File Type: xlsx Datedif_2.xlsx (14.1 KB, 13 views)
Reply With Quote
  #7  
Old 04-13-2017, 11:48 PM
trevorc trevorc is offline Date diff in excel 2007 Windows 7 32bit Date diff in excel 2007 Office 2013
Competent Performer
 
Join Date: Jan 2017
Posts: 174
trevorc will become famous soon enoughtrevorc will become famous soon enough
Default

Is everybody over thinking this ?

G1 = F1-E1
Format G1 as Month, if the answer insn't allready correct.
Reply With Quote
  #8  
Old 04-14-2017, 03:35 AM
otuatail otuatail is offline Date diff in excel 2007 Windows 7 64bit Date diff in excel 2007 Office 2007
Competent Performer
Date diff in excel 2007
 
Join Date: Jun 2012
Posts: 246
otuatail is on a distinguished road
Default

Thanks XOR
=DATEDIF(INDIRECT(E2),INDIRECT(F2),"d")

Never heard of INDIRECT(...)
Reply With Quote
  #9  
Old 04-14-2017, 04:55 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Date diff in excel 2007 Windows 7 64bit Date diff in excel 2007 Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,770
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Just be aware that INDIRECT is a volatile function
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #10  
Old 04-15-2017, 02:32 AM
otuatail otuatail is offline Date diff in excel 2007 Windows 7 64bit Date diff in excel 2007 Office 2007
Competent Performer
Date diff in excel 2007
 
Join Date: Jun 2012
Posts: 246
otuatail is on a distinguished road
Default

INDIRECT is volatile? Not sure what you mean by this!
Reply With Quote
  #11  
Old 04-15-2017, 05:33 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Date diff in excel 2007 Windows 7 64bit Date diff in excel 2007 Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,770
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

http://www.decisionmodels.com/calcsecretsi.htm
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel pivot table with a DATE value field for some reason stops at a certain date angie450 Excel Programming 2 08-19-2014 08:50 AM
Letter date changes when merging with Excel - not the format, the actual date! Smallweed Mail Merge 1 02-07-2014 06:00 PM
Date diff in excel 2007 Date problem in excel 2007 msheyworth Excel 2 06-12-2012 05:10 AM
Date diff in excel 2007 range.insertfile produces diff result between word 2010 and 2007 rsmedley Word 1 02-15-2012 10:48 PM
Colorised diff add-on? liamf Outlook 0 12-15-2010 08:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft