data validation & formulas

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello great folks who have saved me more than once:

I have a data validation list (drop down list) in one
cell, which offers a choice of 3 different selections; in
the next cell I have a formula (would like to have a
formula for each validation). Is it possible to create a
formula that says if this is chosen in the data validation
box, use this formula, if something else is chosen from
the drop down box use another formula, etc? Thus, a
different formula for each choice in the validation list.
Thank you in advance
 
Hi

try

=IF(D6="Cat",A1+B1,IF(D6="Dog",A1*B1,IF(D6="Elephant",A1-B1,"")))

where cat, dog & elephant are the three options you have in your drop down
list in cell D6

Cheers
JulieD
 
you could use embedded IF statements,
=IF(cell='x',formula for 'x',IF(cell='y',formula
for 'y',IF(cell='z',formula for 'z',0)))
 
Hi

Something like this:
=IF(X1="Count",COUNT(A2:A10),IF(X1="Sum",SUM(A2:A10),IF(X1="Average",AVERAGE
(A2:A10),"")))

You can define subformulas as named ranges
fCnt=COUNT($A$2:$A$10)
fSum=SUM($A$2:$A$10)
fAvg=AVERAGE($A$2:$A$10)
now you can have the formula
=IF(X1="Count",fCnt,IF(X1="Sum",fSum,IF(X1="Average",fAvg,"")))
 
try this formula

=IF(cell="x",formula for "x",IF(cell="y",formula
for "y",IF(cell="z",formula for "z",0)))
 
Thanks so much!
-----Original Message-----
you could use embedded IF statements,
=IF(cell='x',formula for 'x',IF(cell='y',formula
for 'y',IF(cell='z',formula for 'z',0)))
.
 
Thank you so much!
-----Original Message-----
Hi

Something like this:
=IF(X1="Count",COUNT(A2:A10),IF(X1="Sum",SUM(A2:A10),IF (X1="Average",AVERAGE
(A2:A10),"")))

You can define subformulas as named ranges
fCnt=COUNT($A$2:$A$10)
fSum=SUM($A$2:$A$10)
fAvg=AVERAGE($A$2:$A$10)
now you can have the formula
=IF(X1="Count",fCnt,IF(X1="Sum",fSum,IF (X1="Average",fAvg,"")))


--
Arvi Laanemets
(Don't use my reply address - it's spam-trap)





.
 
Thank you so much!
-----Original Message-----
Hi

try

=IF(D6="Cat",A1+B1,IF(D6="Dog",A1*B1,IF(D6="Elephant",A1- B1,"")))

where cat, dog & elephant are the three options you have in your drop down
list in cell D6

Cheers
JulieD





.
 
Back
Top