Is this formula correct?

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

Guest

I'm working on an "IF" formula but can't seem to get it to work, here's what I'm trying to calculate
Cell A1 holds a number between 1 & 12

If cell A1=4 I need cell A2 to show "1
If cell A1=8 I need cell A2 to show "2
If cell A1=12 I need cell A2 to show "3

No other numbers should calculate an answer, just the 4, 8 & 12
Suggestions
Thanks
 
Is what formula correct? Did you make a stab at it?

=CHOOSE(A1/4,1,2,3)

If you don't want any message if not 4,8,12, try

=IF(ISNUMBER(CHOOSE(A1/4,1,2,3)),CHOOSE(A1/4,1,2,3),"")
 
I'm working on an "IF" formula but can't seem to get it to work, here's what
I'm trying to calculate:
Cell A1 holds a number between 1 & 12.

If cell A1=4 I need cell A2 to show "1"
If cell A1=8 I need cell A2 to show "2"
If cell A1=12 I need cell A2 to show "3"

No other numbers should calculate an answer, just the 4, 8 & 12.
Suggestions ?

Simplest,

=IF(A1=4,1,IF(A1=8,2,IF(A1=12,3,"")))

More general,

=IF(SUMPRODUCT(COUNTIF(A1,{4,8,12})),MATCH(A1,{4,8,12}),"")
 
Back
Top