View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
joel joel is offline
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?