Maximum of Column A until 0

csvirtual

New Member
Joined
Oct 15, 2005
Messages
25
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
 
Upvote 0
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
 
Upvote 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
 
Upvote 0
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?
 
Upvote 0
excel.jpg


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

Thank you
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top