how to check date difference in excel

springran

Board Regular
Joined
Mar 18, 2014
Messages
56
Office Version
  1. 365
Platform
  1. Windows
Hi there,

In A1 I have 01.05.2017 in B1 I have a formula which show a date ( this date come from other filed). what formula should I use to calculate difference between A1 and B2?

thanks
 
[TABLE="width: 487"]
<tbody>[TR]
[TD]Hi SyedUsman
[TABLE="width: 487"]
<tbody>[TR]
[TD]thank you for your reply.[TABLE="width: 487"]
<tbody>[TR]
[TD]I think I am going to a wrong way. let me explain my issue
[TABLE="width: 487"]
<tbody>[TR]
[TD]In S1 I manually type some word (eg ASN 20.07.17 or Manually 21.07.17.PO line).
[TABLE="width: 487"]
<tbody>[TR]
[TD]In T1 I have a formula which will take the date from S1. if there is word "manually". e.g in T1 shows 20.07.17 IF(IFERROR(SEARCH("Manually",S1,1),0)=1, MID(S11,FIND(" ",S1,1),9), "")
[TABLE="width: 487"]
<tbody>[TR]
[TD]In U1 I have a formula which will take the date from S1 . if there is word"ASN" e.g ASN U1 shows 21.07.17
[TABLE="width: 487"]
<tbody>[TR]
[TD]Now in V1 I want a formula which can calculate the different between S1 and U1. I have formula in S1 and U1,so when I use the date formula it shows #VALUE !.
[TABLE="width: 487"]
<tbody>[TR]
[TD]Can you please help? thanks[/TD]
[/TR]
</tbody><colgroup><col></colgroup>[/TABLE]
[/TD]
[/TR]
</tbody><colgroup><col></colgroup>[/TABLE]
[/TD]
[/TR]
</tbody><colgroup><col></colgroup>[/TABLE]
[/TD]
[/TR]
</tbody><colgroup><col></colgroup>[/TABLE]
[/TD]
[/TR]
</tbody><colgroup><col></colgroup>[/TABLE]
[/TD]
[/TR]
</tbody><colgroup><col></colgroup>[/TABLE]
[/TD]
[/TR]
</tbody><colgroup><col></colgroup>[/TABLE]
[/TD]
[/TR]
</tbody><colgroup><col></colgroup>[/TABLE]
 
Last edited:
Upvote 0

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
=date("20"&right(right(if(len(mid(s2,max(1,find(".",s2)-3),11))=9,(mid(s2,max(1,find(".",s2)-3),11)),substitute((mid(s2,max(1,find(".",s2)-3),11)),".","",3)),len(if(len(mid(s2,max(1,find(".",s2)-3),11))=9,(mid(s2,max(1,find(".",s2)-3),11)),substitute((mid(s2,max(1,find(".",s2)-3),11)),".","",3)))-search(" ",if(len(mid(s2,max(1,find(".",s2)-3),11))=9,(mid(s2,max(1,find(".",s2)-3),11)),substitute((mid(s2,max(1,find(".",s2)-3),11)),".","",3)),1)),2),mid(right(if(len(mid(s2,max(1,find(".",s2)-3),11))=9,(mid(s2,max(1,find(".",s2)-3),11)),substitute((mid(s2,max(1,find(".",s2)-3),11)),".","",3)),len(if(len(mid(s2,max(1,find(".",s2)-3),11))=9,(mid(s2,max(1,find(".",s2)-3),11)),substitute((mid(s2,max(1,find(".",s2)-3),11)),".","",3)))-search(" ",if(len(mid(s2,max(1,find(".",s2)-3),11))=9,(mid(s2,max(1,find(".",s2)-3),11)),substitute((mid(s2,max(1,find(".",s2)-3),11)),".","",3)),1)),4,2),left(right(if(len(mid(s2,max(1,find(".",s2)-3),11))=9,(mid(s2,max(1,find(".",s2)-3),11)),substitute((mid(s2,max(1,find(".",s2)-3),11)),".","",3)),len(if(len(mid(s2,max(1,find(".",s2)-3),11))=9,(mid(s2,max(1,find(".",s2)-3),11)),substitute((mid(s2,max(1,find(".",s2)-3),11)),".","",3)))-search(" ",if(len(mid(s2,max(1,find(".",s2)-3),11))=9,(mid(s2,max(1,find(".",s2)-3),11)),substitute((mid(s2,max(1,find(".",s2)-3),11)),".","",3)),1)),2))

Hi SyedUsman
[TABLE="width: 487"]
<tbody>[TR]
[TD]thank you for your reply.[TABLE="width: 487"]
<tbody>[TR]
[TD]I think I am going to a wrong way. let me explain my issue
[TABLE="width: 487"]
<tbody>[TR]
[TD]In S1 I manually type some word (eg ASN 20.07.17 or Manually 21.07.17.PO line).
[TABLE="width: 487"]
<tbody>[TR]
[TD]In T1 I have a formula which will take the date from S1. if there is word "manually". e.g in T1 shows 20.07.17 IF(IFERROR(SEARCH("Manually",S1,1),0)=1, MID(S11,FIND(" ",S1,1),9), "")
[TABLE="width: 487"]
<tbody>[TR]
[TD]In U1 I have a formula which will take the date from S1 . if there is word"ASN" e.g ASN U1 shows 21.07.17
[TABLE="width: 487"]
<tbody>[TR]
[TD]Now in V1 I want a formula which can calculate the different between S1 and U1. I have formula in S1 and U1,so when I use the date formula it shows #VALUE !.
[TABLE="width: 487"]
<tbody>[TR]
[TD]Can you please help? thanks[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Your last post makes no sense.

Now in V1 I want a formula which can calculate the different between S1 and U1.
S1 doesn't contain a date - it contains a string.

I have formula in S1
You said at the start of your post "In S1 I manually type some word (eg ASN 20.07.17 or Manually 21.07.17.PO line)".

The problem is that the formula you posted is returning a string instead of a date.
Try revising that formula to get it to return a date:
=IF(IFERROR(SEARCH("Manually",S1,1),0), DATEVALUE(SUBSTITUTE(MID(S1,FIND(" ",S1,1)+1,8),".","/")), "")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,829
Messages
6,181,224
Members
453,025
Latest member
Hannah_Pham93

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