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
 
      22nd 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
Automatic Sorting? Ted Microsoft Excel Worksheet Functions 6 10th Jan 2010 06:01 PM
automatic sorting =?Utf-8?B?Z21pc2k=?= Microsoft Excel Worksheet Functions 3 11th Oct 2006 11:33 PM
pass thru queries giving other users result while sorting- Pl help gdc Microsoft Access 1 25th Jun 2004 08:58 PM
Automatic Sorting =?Utf-8?B?RGF2ZQ==?= Microsoft Excel Worksheet Functions 3 19th Mar 2004 04:11 AM
Macro is giving me problems with sorting Tom Ogilvy Microsoft Excel Programming 3 2nd Sep 2003 07:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:13 PM.