Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default List Dependent Worksheet Functions

I am creating a summarising worksheet that evaluates a list of
numbers.

The list of numbers is held in a column of adjacent cells called
'ListVal1'. I wish to evaluate the numeric cells in 5 possible ways as
determined by the user - the analysis could be any one of SUM,
AVERAGE, MIN, MAX or COUNT. The user selects the analytical process by
reference to a text value in a related cell - in this case cell 'B11'.

The following formula works but is both cumbersome and has reached the
limit of nested 'if statements'

=IF(B11="","",IF(B11="SUM",SUM(ListVal1),IF(B11="A VERAGE",AVERAGE(ListVal1),IF(B11="MAX",MAX(ListVal 1),IF(B11="MIN",MIN(ListVal1),IF(B11="COUNT",COUNT (ListVal1),""))))))

Does any one have a more flexible (less cumbersome) approach?

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default List Dependent Worksheet Functions

Is this better?

=lookup(B11,{"","SUM","AVERAGE","MAX","MIN","COUNT ";"",SUM(ListVal1),AVERAGE(ListVal1),MAX(ListVal1) ,MIN(ListVal1),COUNT(ListVal1)})

"Stephen Allen" wrote:

I am creating a summarising worksheet that evaluates a list of
numbers.

The list of numbers is held in a column of adjacent cells called
'ListVal1'. I wish to evaluate the numeric cells in 5 possible ways as
determined by the user - the analysis could be any one of SUM,
AVERAGE, MIN, MAX or COUNT. The user selects the analytical process by
reference to a text value in a related cell - in this case cell 'B11'.

The following formula works but is both cumbersome and has reached the
limit of nested 'if statements'

=IF(B11="","",IF(B11="SUM",SUM(ListVal1),IF(B11="A VERAGE",AVERAGE(ListVal1),IF(B11="MAX",MAX(ListVal 1),IF(B11="MIN",MIN(ListVal1),IF(B11="COUNT",COUNT (ListVal1),""))))))

Does any one have a more flexible (less cumbersome) approach?


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,358
Default List Dependent Worksheet Functions

My recommendation...

First, in B11, set up a data validation (drop down list), for the functions
that you are willing to allow the user to do. I then named cell B11
(Insert|Name|Define) as CalcType.
Second, in another cell (my example will be B12), set up another drop down
list that lists the possible 'ranges' that the person will be able to
calculate. I then named B12 as CalcRange.
Finally, set up a 2 column table somewhere (my preference is to always have
a tab, hidden usually, of just tables). In the first column, I typed the list
of possible selections, SUM, AVERAGE, MAX, MIN, COUNT, and in the 2nd column,
I typed the formulas as =SUM(INDIRECT(CalcRange)),
=AVERAGE(INDIRECT(CalcRange)), =MAX(INDIRECT(CalcRange)),
=MIN(INDIRECT(CalcRange)), =COUNT(INDIRECT(CalcRange)). I then named this
range as CALC.

Then, your formula would be:

=IF(CalcType="","",VLOOKUP(CalcType,Calc,2,FALSE))


--
John C


"Stephen Allen" wrote:

I am creating a summarising worksheet that evaluates a list of
numbers.

The list of numbers is held in a column of adjacent cells called
'ListVal1'. I wish to evaluate the numeric cells in 5 possible ways as
determined by the user - the analysis could be any one of SUM,
AVERAGE, MIN, MAX or COUNT. The user selects the analytical process by
reference to a text value in a related cell - in this case cell 'B11'.

The following formula works but is both cumbersome and has reached the
limit of nested 'if statements'

=IF(B11="","",IF(B11="SUM",SUM(ListVal1),IF(B11="A VERAGE",AVERAGE(ListVal1),IF(B11="MAX",MAX(ListVal 1),IF(B11="MIN",MIN(ListVal1),IF(B11="COUNT",COUNT (ListVal1),""))))))

Does any one have a more flexible (less cumbersome) approach?


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default List Dependent Worksheet Functions

My thanks to both Joel and John C

I will probably try Joel's approach mainly because I have been totally
remiss and never used array formulae before. This is as good a place
to start as any.
Thanks again
Stephen Allen

On Jul 22, 2:38*pm, John C <johnc@stateofdenial wrote:
My recommendation...

First, in B11, set up a data validation (drop down list), for the functions
that you are willing to allow the user to do. I then named cell B11
(Insert|Name|Define) as CalcType.
Second, in another cell (my example will be B12), set up another drop down
list that lists the possible 'ranges' that the person will be able to
calculate. I then named B12 as CalcRange.
Finally, set up a 2 column table somewhere (my preference is to always have
a tab, hidden usually, of just tables). In the first column, I typed the list
of possible selections, SUM, AVERAGE, MAX, MIN, COUNT, and in the 2nd column,
I typed the formulas as =SUM(INDIRECT(CalcRange)),
=AVERAGE(INDIRECT(CalcRange)), =MAX(INDIRECT(CalcRange)),
=MIN(INDIRECT(CalcRange)), =COUNT(INDIRECT(CalcRange)). I then named this
range as CALC.

Then, your formula would be:

=IF(CalcType="","",VLOOKUP(CalcType,Calc,2,FALSE))

--
John C



"Stephen Allen" wrote:
I am creating a summarising worksheet that evaluates a list of
numbers.


The list of numbers is held in a column of adjacent cells called
'ListVal1'. I wish to evaluate the numeric cells in 5 possible ways as
determined by the user - the analysis could be any one of SUM,
AVERAGE, MIN, MAX or COUNT. The user selects the analytical process by
reference to a text value in a related cell - in this case cell 'B11'.


The following formula works but is both cumbersome and has reached the
limit of nested 'if statements'


=IF(B11="","",IF(B11="SUM",SUM(ListVal1),IF(B11="A VERAGE",AVERAGE(ListVal1)*,IF(B11="MAX",MAX(ListVa l1),IF(B11="MIN",MIN(ListVal1),IF(B11="COUNT",COUN T*(ListVal1),""))))))


Does any one have a more flexible (less cumbersome) approach?- Hide quoted text -


- Show quoted text -


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting worksheet dependent on columns drop down list PCoyne Excel Discussion (Misc queries) 3 July 4th 07 12:33 AM
Return a list dependent upon the selection of a preceeding list Aja K Excel Worksheet Functions 4 April 11th 07 07:48 PM
WORKSHEET FUNCTIONS - LIST OF ALL ?? lightswitch80 Excel Worksheet Functions 2 May 25th 06 11:21 PM
How do I create a dependent list, to a current list? elevenphil Excel Discussion (Misc queries) 1 January 30th 06 04:35 PM
How to get the complete list Excel Worksheet Functions phil Excel Worksheet Functions 1 September 5th 05 01:36 PM


All times are GMT +1. The time now is 08:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"