Date Formula

fairchance

Board Regular
Joined
Jan 4, 2015
Messages
110
Dear Sir,

I am seeking data formula/function that could calculate the number of days from the expected date to actual date.
I can come up with formula to calculate the number of dates between real dates and expected dates. Here is the example parameters:

Range Definition:(days of month)
Beg 1-10
mid 11-20
End 21-30

<tbody>
</tbody>
Expacted date for submission Actual Date Formula
21-Dec-1421-Dec-140
21-Dec-1418-Dec-14-3
21-Dec-1427-Dec-146
Beg Dec 149-Dec-14 #VALUE!
End Dec 1418-Dec-14 #VALUE!
Mid Dec 1427-Dec-14 #VALUE!

<tbody>
</tbody>
How can i calculate date difference in case of date relate to particular range? Any one can help please.

Regards

Shehbaz

<tbody>
</tbody>
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
Well in those terms you cant!!
You can calculate a range of date differences (date of start of range to expected date) to (date of end of range to expected date)
Or
You can calculate and average date difference (date of midpoint of range to expected date)
All depends on what you want to do with the answer
 
Upvote 0
The only way (I think) would be to assign a value to "Beg", "Mid" & "End, e.g. 1, 15 & 31. Then use those in your calculations.
 
Upvote 0
With the data you have, you cannot.

My recomendaton would be to change the estimated dates to incorporate a real live date. maybe, Beg Dec could be 01 Dec, End Nov as 30 Nov, mid Mar as 15 Mar.

Otherwise, you simply can't calculate this- that's not how maths works...
 
Upvote 0
Shehbaz,

Your question is not logical. How can you subtract between a fix value and range of values. Like 20 minus Big (where Big ca be between 1 and 10). Please understand. either you fix the value of Beg (like 1), Mid=15 and End-30 as already suggest in this forum.
Other issue is if cell value is "Beg Dec 14" so it becomes text, which need to be converted in to Date. That can be done by formulas if the year is 2014.

We will help you if your concepts are clear.

Regards,

A.B. Mati
Doha, Qatar
 
Last edited:
Upvote 0
I would need to calculate all possible ranges depending on the actual date, as it will differ in most of the cases.
That is, if for example, I have expected date is Mid Feb and actual date is 23 Feb, it should come out positive value of +3, as the range value for Mid is 11 to 20
- for example If expected date is Mid Feb and actual date is 15 feb, the value should be 0, as it was within the range of Mid
- Expected date is Mid Feb and the actual date is 09 Feb, the value should be -2, as range starts at 11.

I hope you are clear now. Now tell me what is the formula for it?
 
Upvote 0
Hi Fairchance,

I think I can see what you're after, but excel is basically a calculator and they're not very good with soft concepts like beg or mid as you've described them. The scenarios you've described in your post above do help. But, for example what would you calculate if the date wer 17 feb if Mid Feb is expected. Based on the data above it can't be +2 because that's been calculated from the end of the range and would in your early example. it would equally be confusing to say it was -3. There are many other undefined scenarios based on such a loose concept as Beg or Mid.

The forum will undoubtedly provide an answer, but the first step is for you to recognise the comment made in post #2, and bring clarity to the calculations you want to perform. It might help if you provide a list of dates from 1st month to the last day and show what you want to be calculated for each day. That will also help you understand the problems described above.

I know this isn't what you want, but a little effort now will pay dividends in the end (ie you'll get an answer).

Regards
 
Upvote 0
Hi pjmorris

Please forget all above. i may clarify you with the following:

A B C
1 Expacted Date Real Date Formula (b-a)
2 beg Jan 14 17-jan-14 +7
3 mid jan 14 30-jan-14 +10
4 end jan 14 15-jan-14 -15
5 15-01-14 25-01-2014 +10

The question is that how the formula will be formed to recognize the values of expected date text i.e. end,mid,beg etc. We must convert these texts into number of ending range value then convert it into date format and then include it within formula. I hope you understand now. So what is the single formula to calculate such mixed values i.e. real date and exacted date? All Excel Expert and Gurus are also invited.

Regards
Fairchance
 
Upvote 0
Insert a new column in-between "Exp Date" & "Act Date"
enter formula
=IF(LEFT(A2,3)="Beg",10&RIGHT(A2,7),IF(LEFT(A2,3)="Mid",20&RIGHT(A2,7),IF(LEFT(A2,3)="End",30&RIGHT(A2,7),A2)))
This will give you new dates to use in your calc.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,576
Members
448,972
Latest member
Shantanu2024

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