# AVERAGE / MEDIAN formula question

#### 12345678

##### New Member
Formulas question:

How can I create a condition to pull information from one column based on another column (like a VLOOKUP), and average the information in all the cells according to the criteria (without changing when I re-sort the data set)?

For example, I have three columns of data:

AGE WEIGHT HEIGHT
7 70 48
7 75 51
8 90 42
8 87 53

What formula(s) do I need to get an average and median height and for all people age 7?

thanks

### Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi, welcome to the board!

Something like this:

For Median:
=MEDIAN(IF(\$A\$2:\$A\$5=7,\$C\$2:\$C\$5))

Confirm with CTRL-SHIFT-ENTER rather than just Enter

For Average:
=AVERAGE(IF(\$A\$2:\$A\$5=7,\$C\$2:\$C\$5))

Confirm with CTRL-SHIFT-ENTER rather than just Enter

Enter the following formual WITHOUT THE CURLY BRACES. Then confirm with CONTROL SHIFT ENTER (NOT JUST ENTER). For median , just replace average with median

{=AVERAGE(IF(A1:A4=7,C1:C4))}

Gene, "The Mortgage Man, Klein

Replies
4
Views
331
Replies
10
Views
370
Replies
8
Views
215
Replies
4
Views
172
Replies
8
Views
321

1,221,384
Messages
6,159,544
Members
451,571
Latest member
Qwissy

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