# Help with medianif function

#### jrudner

##### Board Regular
Hi, I know there is an existing median if thread, but it is not resolving the problem I have.

My formula below is as follows:

=MEDIAN(IF(Test!\$G\$2:\$G\$13215=B14,Test!\$B\$2:\$B\$13215))

I seem to be having difficulties referencing data on another worksheet. The formula is on the same sheet that B14 is on.

I enter it as an array format, but I get #NUM! as a result.

JRudner

### Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

##### MrExcel MVP
If B14 is not available in Test!\$G\$2:\$G\$13215, you'd get a #NUM! error...

What do you get with?...

=COUNTIF(Test!\$G\$2:\$G\$13215,B14)

#### jrudner

##### Board Regular
That gives me the correct number, 4428 rows that match.

#### barry houdini

##### MrExcel MVP
Possibly numbers in column B are text formatted? Try

=MEDIAN(IF(Test!\$G\$2:\$G\$13215=B14,Test!\$B\$2:\$B\$13215+0))

#### jrudner

##### Board Regular

Barry, that gives me the #NUM! error as well.

#### AusSteelMan

##### Board Regular
Hi there,

I wish I could be more help, but thought I would let you know that I copy and pasted your formula as is and populated tab name and columns and got a result.

In fact, I got a result when the formula was entered as a CSE array formula and even as a regular formula.

Initially I thought it may have been because you did not have " ' " around your sheet name, but I was wrong with the example you gave. However if your sheet name has a SPACE in it, you will need them. eg

Code:
``=MEDIAN(IF('test sheet'!\$G\$2:\$G\$13215=B14,'test sheet'!\$B\$2:\$B\$13215))``

Hope this is useful, even if not directly helping.

ASM

#### jrudner

##### Board Regular
That worked! When I put the single quote around the worksheet name it worked properly. Strange, but thanks a ton!

JRudner

#### AusSteelMan

##### Board Regular
Matter of interest: what is your sheet name? Or at least does it have a SPACE?

Replies
3
Views
93
Replies
6
Views
173
Replies
26
Views
1K
Replies
4
Views
115
Replies
9
Views
377

1,129,804
Messages
5,638,455
Members
417,025
Latest member
MusterDuster

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