# Offset + Median Function

#### matman

##### Board Regular
I have a list of numbers from cell A1 to DD1, each cell representing a month.

I need to be able to calculate the median of any number of these cells by the use of a variable cell e.g B1, but always starting at A1

For example if B1 was 10 the result would be =median(A1:J1).

I'm sure that OFFSET can be used but I just can't it to work.

Many thanks

### Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
=MEDIAN(A1:OFFSET(a1,0,B1-1))

Would that be --

=MEDIAN(A1:INDEX(A1:DD1,0,B1))

Thanks guys,

I've now also used

=median(offset(A1,0,0,1,B1))

Replies
8
Views
277
Replies
5
Views
578
Replies
3
Views
682
Replies
13
Views
562
Replies
2
Views
183

1,203,323
Messages
6,054,728
Members
444,747
Latest member
Jaborsum

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