PC Review


Reply
Thread Tools Rate Thread

Conditional Max

 
 
Mika
Guest
Posts: n/a
 
      4th Jun 2006
Hi,

I have in column A, several ranges separated for, letsīs say the
character "-". I need to find the max of that range and put it in
column b, however I can not find a formula that find the maximum of a
sequence of numbers until it finds the first "-"
Of course, the numbers in columa A are the result of formulas, so the
order values etc changes with user input.

The solution should look like:

column A Column B
-
-
2 6
5
1
6
-
3 8
8
1
-
-
-
Thanks for your time
Mika

 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      4th Jun 2006
I just did one like this for a client. You need a macro to find the first -
then find the second - and max >then loop to the next group until finished.

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Mika" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
Hi,

I have in column A, several ranges separated for, letsīs say the
character "-". I need to find the max of that range and put it in
column b, however I can not find a formula that find the maximum of a
sequence of numbers until it finds the first "-"
Of course, the numbers in columa A are the result of formulas, so the
order values etc changes with user input.

The solution should look like:

column A Column B
-
-
2 6
5
1
6
-
3 8
8
1
-
-
-
Thanks for your time
Mika


 
Reply With Quote
 
=?Utf-8?B?Um9uIENvZGVycmU=?=
Guest
Posts: n/a
 
      4th Jun 2006
Try something like this:

With your list of values in Col_A, with a column title in A1 and values, or
dashes, below"

B2:
=IF(AND(A1="-",ISNUMBER(A2)),MAX(OFFSET(A2,,,MATCH("-",$A2:$A$65536,0),1)),"")

Copy B2 down as far as you need.

Is that something you can work with?
***********
Regards,
Ron

XL2002, WinXP


"Mika" wrote:

> Hi,
>
> I have in column A, several ranges separated for, letsÂīs say the
> character "-". I need to find the max of that range and put it in
> column b, however I can not find a formula that find the maximum of a
> sequence of numbers until it finds the first "-"
> Of course, the numbers in columa A are the result of formulas, so the
> order values etc changes with user input.
>
> The solution should look like:
>
> column A Column B
> -
> -
> 2 6
> 5
> 1
> 6
> -
> 3 8
> 8
> 1
> -
> -
> -
> Thanks for your time
> Mika
>
>

 
Reply With Quote
 
Mika
Guest
Posts: n/a
 
      4th Jun 2006
Thanks both,


Don you are right with vba is piece of cake, but not possible for this
work.

Ron, I included at the beggining of those cells a comment:
"solution proposed by Ron Coderre"


Thanks it worked like a charm !

Mika

 
Reply With Quote
 
=?Utf-8?B?Um9uIENvZGVycmU=?=
Guest
Posts: n/a
 
      4th Jun 2006
Thanks for the feedback, Mika....I'm glad that worked for you.

***********
Regards,
Ron

XL2002, WinXP


"Mika" wrote:

> Thanks both,
>
>
> Don you are right with vba is piece of cake, but not possible for this
> work.
>
> Ron, I included at the beggining of those cells a comment:
> "solution proposed by Ron Coderre"
>
>
> Thanks it worked like a charm !
>
> Mika
>
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      4th Jun 2006
>not possible for this work.
Why not

lr = Cells(Rows.Count, "a").End(xlUp).Row
c1 = 1
Do Until c1 + 1 >= lr
c1 = Range(Cells(c1, 1), Cells(lr, 1)).Find("-").Row
c2 = Range(Cells(c1 + 1, 1), Cells(lr, 1)).Find("-").Row - 1
Cells(c2, 2) = Application.Max(Range(Cells(c1, 1), Cells(c2, 1)))
c1 = Range(Cells(c2, 1), Cells(lr, 1)).Find("-").Row - 1
Loop

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Mika" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks both,
>
>
> Don you are right with vba is piece of cake, but not possible for this
> work.
>
> Ron, I included at the beggining of those cells a comment:
> "solution proposed by Ron Coderre"
>
>
> Thanks it worked like a charm !
>
> Mika
>



 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      4th Jun 2006
Improvement if no - at the bottom

lr = Cells(Rows.Count, "a").End(xlUp).Row
If Cells(lr, 1) <> "-" Then
Cells(lr + 1, 1) = "-"
lr = lr + 1
End If
c1 = 1
Do Until c1 + 1 >= lr
c1 = Range(Cells(c1, 1), Cells(lr, 1)).Find("-").Row
c2 = Range(Cells(c1 + 1, 1), Cells(lr, 1)).Find("-").Row - 1
Cells(c2, 2) = Application.Max(Range(Cells(c1, 1), Cells(c2, 1)))
c1 = Range(Cells(c2, 1), Cells(lr, 1)).Find("-").Row - 1
Loop

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Don Guillett" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> >not possible for this work.

> Why not
>
> lr = Cells(Rows.Count, "a").End(xlUp).Row
> c1 = 1
> Do Until c1 + 1 >= lr
> c1 = Range(Cells(c1, 1), Cells(lr, 1)).Find("-").Row
> c2 = Range(Cells(c1 + 1, 1), Cells(lr, 1)).Find("-").Row - 1
> Cells(c2, 2) = Application.Max(Range(Cells(c1, 1), Cells(c2, 1)))
> c1 = Range(Cells(c2, 1), Cells(lr, 1)).Find("-").Row - 1
> Loop
>
> --
> Don Guillett
> SalesAid Software
> (E-Mail Removed)
> "Mika" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Thanks both,
>>
>>
>> Don you are right with vba is piece of cake, but not possible for this
>> work.
>>
>> Ron, I included at the beggining of those cells a comment:
>> "solution proposed by Ron Coderre"
>>
>>
>> Thanks it worked like a charm !
>>
>> Mika
>>

>
>



 
Reply With Quote
 
Mika
Guest
Posts: n/a
 
      5th Jun 2006
Thanks Don,

Sorry for not explaining clearly, but it is not allowed to use macros
in this spreadsheet. Thatīs why I didnīt post it in the program area.

Rgd
Mika

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to apply a conditional Select distinct (or conditional Where onduplicated cell values in a column) Jamie Microsoft Access Queries 3 2nd Oct 2009 07:39 PM
Conditional Formatting No Longer Conditional in 2007 Beta =?Utf-8?B?Q2FjdHVhci1Oby1KdXRzdQ==?= Microsoft Excel Crashes 0 17th Nov 2006 10:01 PM
Using query results within Conditional Statement...sequenced conditional queries rafael.farias.jr@gmail.com Microsoft Access 3 30th Aug 2006 02:08 PM
Conditional Formatting that will display conditional data =?Utf-8?B?QnJhaW5GYXJ0?= Microsoft Excel Worksheet Functions 1 13th Sep 2005 05:45 PM
Re: Multiple conditional on conditional format formula Bob Phillips Microsoft Excel Programming 0 27th Jul 2004 05:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:58 PM.