# Maximum of Column A until 0

#### csvirtual

##### New Member
Hi!

In column B I need to have the maximum of all Rows in column A until a cell has the value 0.

Example:
..A B
1 2 3
2 3 3
3 1 1
4 0
5 1 5
6 3 5
7 5 5
8 1 1
9 0

Any help appreciated

thx
Christian

### Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi,

This is not really as you presented it, but is this something like what is expected?
Book7
ABCD
1111
2233
3313
4414
550
6636
7757
8818
990
10
11
Sheet1

Copy down the formula in C1.

Hope this helps

RAM

csvirtual

Try this. Formula in B1 (copied down):
=IF(A1=0,"",MAX(OFFSET(A1,0,0,MATCH(0,A1:A\$9,0))))
Mr Excel.xls
ABCD
123
233
311
40
515
635
755
811
90
10
Max Till 0

@Ram: Thank You but the first Column was just the Row.

@Peter_SSs

Thank You. It's the right formula.
I have one Problem: I would like to have it this way and i just changed the Cells but it doesnt work (#NV):

=IF(W8=0,0,MAX(OFFSET(E8,0,0,MATCH(0,E8:e\$65536,0))))

What's wrong with it?
If in Cell W... is a 0 than take the maximum of E65536 to E8 (as it should start from bottom) until W..=0

Hope You can help me again.

thanks

csvirtual said:
...
I have one Problem: I would like to have it this way and i just changed the Cells but it doesnt work (#NV):

=IF(W8=0,0,MAX(OFFSET(E8,0,0,MATCH(0,E8:e\$65536,0))))

What's wrong with it?
If in Cell W... is a 0 than take the maximum of E65536 to E8 (as it should start from bottom) until W..=0

Hope You can help me again.

thanks
Please try to expalin again more clearly. Your formula starts off IF(W8=0,0,... but your explanation says 'If in Cell W... is a 0 than take the maximum of E65536 to E8'. These seem to contradict.

Perhaps you could give another small sample of data (columns E and W at least) and the expected results?

I hope you understand. I find it difficult to say it in words, as my english is not that good.

Thank you

OK

You were not far off. In AJ2 try this and copy down:
=IF(W2=0,0,MAX(OFFSET(E2,0,0,MATCH(0,W:W,0))))

Edit: Sorry this does not do it, I will need to re-think this.

Trying again, AJ2:
=IF(W2=0,0,MAX(OFFSET(E2,0,0,MATCH(0,W2:W\$65536,0))))

This is close to what you had but the MATCH for zero needs to be on column W, not E. With this formula, the last value in column W will need to be 0 or there will be some #N/A errors at the bottom of column AJ.

Thank you peter!

It works fine.

have a nice in down under

Replies
4
Views
362
Replies
5
Views
174
Replies
13
Views
384
Replies
4
Views
309
Replies
1
Views
382

1,217,347
Messages
6,136,045
Members
449,982
Latest member
josephinelinnea

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