PC Review


Reply
Thread Tools Rate Thread

Automatic sorting (giving max and min) based on custom sorting lis

 
 
Joe Lewis
Guest
Posts: n/a
 
      22nd Nov 2008
Suppose I have a bunch of cells with a drop-down list allow users to choose
between the folowing values:

pppp
ppp
pp
p
mp
mf
f
ff
fff
ffff

How do I write a function that will look through all the cells where someone
has chosen a value (all non-blank cells) and pull out the max and min value
where the "max" and "min" are based on the custom list above (i.e. "pppp" is
the smallest value possible and "ffff" is the largest value possible)?

I would like for Excel to do this automatically for the user, and update
itself as the data might change.

Is this possible?

Thanks for any information you can provide.
 
Reply With Quote
 
 
 
 
T. Valko
Guest
Posts: n/a
 
      22nd Nov 2008
>I have a bunch of cells with a drop-down list

Are the cells with the drop downs in a contiguous range? Like A1:A5.

>where someone has chosen a value (all non-blank cells)


Will there be any empty cells?


--
Biff
Microsoft Excel MVP


"Joe Lewis" <(E-Mail Removed)> wrote in message
news:93A07190-1D21-4F0F-89D8-(E-Mail Removed)...
> Suppose I have a bunch of cells with a drop-down list allow users to
> choose
> between the folowing values:
>
> pppp
> ppp
> pp
> p
> mp
> mf
> f
> ff
> fff
> ffff
>
> How do I write a function that will look through all the cells where
> someone
> has chosen a value (all non-blank cells) and pull out the max and min
> value
> where the "max" and "min" are based on the custom list above (i.e. "pppp"
> is
> the smallest value possible and "ffff" is the largest value possible)?
>
> I would like for Excel to do this automatically for the user, and update
> itself as the data might change.
>
> Is this possible?
>
> Thanks for any information you can provide.



 
Reply With Quote
 
 
 
 
Shane Devenshire
Guest
Posts: n/a
 
      23rd Nov 2008
Hi,

I don't understand how the title "automatic sorting" fits into the problems
below??

However, this may be a start, assuming the users are entering info in column
A and you custom list is in G1:G10 then the

Max:
=INDEX(G1:G10,MAX(IF(ISNUMBER(MATCH(A1:A9,G1:G10,0)),MATCH(A1:A9,G1:G10,0))),0)
Min:
=INDEX(G1:G10,MIN(IF(ISNUMBER(MATCH(A1:A9,G1:G10,0)),MATCH(A1:A9,G1:G10,0))),0)

These are both array formulas, so you must press Shift+Ctrl+Enter to enter
them.

if this helps, please click the Yes button

Cheers,
Shane Devenshire

"Joe Lewis" wrote:

> Suppose I have a bunch of cells with a drop-down list allow users to choose
> between the folowing values:
>
> pppp
> ppp
> pp
> p
> mp
> mf
> f
> ff
> fff
> ffff
>
> How do I write a function that will look through all the cells where someone
> has chosen a value (all non-blank cells) and pull out the max and min value
> where the "max" and "min" are based on the custom list above (i.e. "pppp" is
> the smallest value possible and "ffff" is the largest value possible)?
>
> I would like for Excel to do this automatically for the user, and update
> itself as the data might change.
>
> Is this possible?
>
> Thanks for any information you can provide.

 
Reply With Quote
 
Joe Lewis
Guest
Posts: n/a
 
      23rd Nov 2008
Thank you so much. That worked perfectly!

"Shane Devenshire" wrote:

> Hi,
>
> I don't understand how the title "automatic sorting" fits into the problems
> below??
>
> However, this may be a start, assuming the users are entering info in column
> A and you custom list is in G1:G10 then the
>
> Max:
> =INDEX(G1:G10,MAX(IF(ISNUMBER(MATCH(A1:A9,G1:G10,0)),MATCH(A1:A9,G1:G10,0))),0)
> Min:
> =INDEX(G1:G10,MIN(IF(ISNUMBER(MATCH(A1:A9,G1:G10,0)),MATCH(A1:A9,G1:G10,0))),0)
>
> These are both array formulas, so you must press Shift+Ctrl+Enter to enter
> them.
>
> if this helps, please click the Yes button
>
> Cheers,
> Shane Devenshire
>
> "Joe Lewis" wrote:
>
> > Suppose I have a bunch of cells with a drop-down list allow users to choose
> > between the folowing values:
> >
> > pppp
> > ppp
> > pp
> > p
> > mp
> > mf
> > f
> > ff
> > fff
> > ffff
> >
> > How do I write a function that will look through all the cells where someone
> > has chosen a value (all non-blank cells) and pull out the max and min value
> > where the "max" and "min" are based on the custom list above (i.e. "pppp" is
> > the smallest value possible and "ffff" is the largest value possible)?
> >
> > I would like for Excel to do this automatically for the user, and update
> > itself as the data might change.
> >
> > Is this possible?
> >
> > Thanks for any information you can provide.

 
Reply With Quote
 
T. Valko
Guest
Posts: n/a
 
      23rd Nov 2008
Try these...shorter, fewer function calls, normally entered.

For the MAX:

=LOOKUP(2,1/COUNTIF(A1:A5,G1:G10),G1:G10)

For the MIN:

=INDEX(G1:G10,MATCH(TRUE,INDEX(COUNTIF(A1:A5,G1:G10)>0,,1),0))

Where:

A1:A5 = drop down lists
G1:G10 = items listed from lowest value to highest value

--
Biff
Microsoft Excel MVP


"T. Valko" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> >I have a bunch of cells with a drop-down list

>
> Are the cells with the drop downs in a contiguous range? Like A1:A5.
>
>>where someone has chosen a value (all non-blank cells)

>
> Will there be any empty cells?
>
>
> --
> Biff
> Microsoft Excel MVP
>
>
> "Joe Lewis" <(E-Mail Removed)> wrote in message
> news:93A07190-1D21-4F0F-89D8-(E-Mail Removed)...
>> Suppose I have a bunch of cells with a drop-down list allow users to
>> choose
>> between the folowing values:
>>
>> pppp
>> ppp
>> pp
>> p
>> mp
>> mf
>> f
>> ff
>> fff
>> ffff
>>
>> How do I write a function that will look through all the cells where
>> someone
>> has chosen a value (all non-blank cells) and pull out the max and min
>> value
>> where the "max" and "min" are based on the custom list above (i.e. "pppp"
>> is
>> the smallest value possible and "ffff" is the largest value possible)?
>>
>> I would like for Excel to do this automatically for the user, and update
>> itself as the data might change.
>>
>> Is this possible?
>>
>> Thanks for any information you can provide.

>
>



 
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 do I get Outlook to automatic load a name from my contact lis. njrj Microsoft Outlook Contacts 1 8th May 2010 04:00 PM
Validation lists that change based on a selection from another lis Ayo Microsoft Excel Misc 2 23rd Feb 2008 04:36 AM
Validation lists that change based on a selection from another lis Ayo Microsoft Excel Programming 0 21st Feb 2008 04:45 PM
How do I get MAX, MAX -1, MAX -2 pilzner Microsoft Excel Misc 2 5th Aug 2005 07:57 PM
How do I create validation lists which change based on another lis =?Utf-8?B?UGV0ZQ==?= Microsoft Excel Programming 8 22nd Apr 2005 08:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:00 AM.