# # value error in Median formual

#### kvisaria

##### New Member
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

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
.
.

Your IF function doesn't look right. It should have this syntax:

IF(logical_test, [value_if_true], [value_if_false])

IF function - Excel

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

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?

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.

It worked. Thanks so much for your help!!

You're welcome. Glad it worked out

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))

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.

It works. thanks so much for your help!!

Replies
2
Views
120
Replies
8
Views
382
Replies
1
Views
321
Replies
4
Views
285
Replies
7
Views
379

1,206,755
Messages
6,074,757
Members
446,084
Latest member
WalmitAal

### 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.

### Which adblocker are you using?

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

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