Finding Median between two dates

sbehrens

New Member
Joined
Aug 19, 2011
Messages
3
Hi, newbie here,

My question is this:

I have a query in access with two columns of dates

Example:

1WKBegin (5-9) 1WKEnd

and I am trying to find median for them, I tried the following formulas;

Exp1: [1WKEnd] - [1WKBegin (5-9)] / 2
Exp1: ([1WKEnd] - [1WKBegin (5-9)]) / 2

I got a date but it is the wrong date. Can anyone help me on this?
Thxs
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Median: (from Wikipedia)
a median is described as the numerical value separating the higher half of a sample, a population, or a probability distribution, from the lower half. The median of a finite list of numbers can be found by arranging all the observations from lowest value to highest value and picking the middle one. If there is an even number of observations, then there is no single middle value; the median is then usually defined to be the mean of the two middle values
 
Upvote 0
:rofl: Ok, so I am using the wrong word here, forgive me my sin, it is 5:40pm and I'm still at work on a Friday night trying to figure this out :biggrin:

Is there anyway I can find the middle between two dates or close to it, if it is even number?

That was assignment that was given to me by the boss lady. Is there any hope for me or do I start crying now. :)
 
Upvote 0
Haven't tried it out but maybe:

Code:
Exp1: [1WKBegin (5-9)] + Round(([1WKEnd] - [1WKBegin (5-9)] / 2), 0)

(i.e., add the average of the days to the the first day. Rounding will keep it to whole days.).
 
Upvote 0
Thank you for answering my question everyone. I've been working on this all week :)

I tried different variations of the formula for the DateDiff but I keep getting a number rather than a date, this is formula;

Exp1: DateDiff('d',[OPDay],[1WkEnd])

I also, tried the other formula;

Exp1: [1WKBegin (5-9)] + Round(([1WKEnd] - [1WKBegin (5-9)] / 2), 0)

with no luck either

any suggestion :confused:

Thanks
 
Upvote 0
I tried different variations of the formula for the DateDiff but I keep getting a number rather than a date,

you're supposed to get a number
it gives you the number of days between dates

so do datediff on jan 1 2011 and dec 31 2011 and it would give 365 (or 364)
now take 1/2 of that
1/2 of 365 is 183 more or less
now do dateadd jan 1 2011 and 183 and that will give you the date that's 1/2 way in between

look at the links I posted
go to the links, scroll down and look at the examples
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,843
Members
452,948
Latest member
UsmanAli786

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