# value error in Median formual

kvisaria

New Member
Joined
Jun 27, 2007
Messages
27
I am getting #value error when I try below formula. Can someone please advise

=MEDIAN(M7:M7382, IF($C$7:$C$7382,">="&DATE(2013,1,1),OR($C$7:$C$7382,"<="&DATE(2013,12,31))))
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Vidar

Well-known Member
Joined
Jul 19, 2012
Messages
1,254
I am getting #value error when I try below formula. Can someone please advise

=MEDIAN(M7:M7382, IF($C$7:$C$7382,">="&DATE(2013,1,1),OR($C$7:$C$7382,"<="&DATE(2013,12,31))))

You formula looks like an array formula ,but maybe it should look like this?
=MEDIAN(M7:M7382, IF(OR($C$7:$C$7382,">="&DATE(2013,1,1),$C$7:$C$7382,"<="&DATE(2013,12,31)),M7:M7382))

Confirm With Ctrl+Shift+Enter, not just Enter
 

kvisaria

New Member
Joined
Jun 27, 2007
Messages
27
You formula looks like an array formula ,but maybe it should look like this?
=MEDIAN(M7:M7382, IF(OR($C$7:$C$7382,">="&DATE(2013,1,1),$C$7:$C$7382,"<="&DATE(2013,12,31)),M7:M7382))

Confirm With Ctrl+Shift+Enter, not just Enter

I am getting #value error, do you know why?
 

Vidar

Well-known Member
Joined
Jul 19, 2012
Messages
1,254

ADVERTISEMENT

Hi

I was a bit to quick there With my answer ;). Lot of errors in my formula. Try this one:
=MEDIAN(IF(OR($C$7:$C$7382>=DATE(2013,1,1),$C$7:$C$7382<=DATE(2013,12,31)),$M$7:$M$7382))
And remember to confirm With Ctrl+Shift+Enter.
 

Vidar

Well-known Member
Joined
Jul 19, 2012
Messages
1,254

ADVERTISEMENT

You're welcome. Glad it worked out :)
 

kvisaria

New Member
Joined
Jun 27, 2007
Messages
27
I am sorry, it works but didn't realize that its including all the dates in between so its including all the dates that are in 2014 also. Not sure why
Name Date Rate
A 5-Apr-12 12
B 9-Apr-12 13
C 9-Apr-12 14
D 11-Apr-12 15
E 13-Apr-12 16
F 14-Jan-14 20
G 15-Jan-14 21
H 16-Jan-14 22
I 13-Apr-12 17
J 13-Apr-12 18

MEDIAN(IF(OR(B2:B11>=DATE(2012,4,5),B2:B11<=DATE(2012,4,13)),C2:C11))
 

Vidar

Well-known Member
Joined
Jul 19, 2012
Messages
1,254
You're right
I'm Learning something New every day. The OR function can't be used for this purpose. Try this instead:
=MEDIAN(IF(B2:B11>=DATE(2012,4,5),IF(B2:B11<=DATE(2012,4,13),C2:C11)))
And again, remember to confirm With Ctrl+Shift+Enter.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,717
Messages
5,833,288
Members
430,202
Latest member
Faizal5zl

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
Top