If statement

  • Thread starter Thread starter Hendrix10
  • Start date Start date
H

Hendrix10

I'm trying to create an if statement with multiple values but it
doesn't seem to be working.

ie...I have a column that has different values (1,2,3,4,5). 1=daily,
2=weekly, 3=monthly, 4= quartely and 6=annually. I would like to have
another cell with the associate value. So, if a1=1 then daily, if a1=2
then weekly, if a1=3 then monthly, etc...

How would I do this?
 
Thanks, that worked.

What do I do if I have a 0 in my 1st column since it seems that the
choose function starts at 1?
 
=LOOKUP(A1,{0,1,2,3,4,5},{"","daily","weekly","monthly","quarterly","annually"})
 
What do you mean? If the cell is zero that formula will return a blank cell
and what does "it didn't work" means?

--


Regards,


Peo Sjoblom
 
What do you mean? If the cell is zero that formula will return a blank cell
and what does "it didn't work" means?
When I put in the =if(A1=0,"", choose, etc)....I received a return of
"#value!"
not a blank cell.
 
That one returned "#N/A".

BTW, I'm using excel 97

Which one? Of what?

PLEASE remember to include sufficient text from the message to which you are
replying to make your reply understandable ON ITS OWN.
 
I use '97 as well and it works fine for me.........perhaps your cell is not
empty, but may contain a space...........

Vaya con Dios,
Chuck, CABGx3
 
Not if you use

=IF(A1=0,"",CHOOSE(A1,"daily","weekly","monthly","quarterly","annually"))

I don't understand why you would change my formula and use "0" instead?
Where did I put those
quotes?


--


Regards,


Peo Sjoblom
 
Then cell A1 doesn't contain the numerical value 0. It may be text that
looks like 0, or something else, but it isn't the numerical value 0.
 
This is exactly what my formula looks like:

=IF(Q2=0,"",CHOOSE(Q2,"Weekly","Monthly","Quarterly","Every Four
Months","Semi Annually","Annually"))

Q2 is the field in my worksheet that I'm referencing to.
 
Stephen said:
Then cell A1 doesn't contain the numerical value 0. It may be text
that looks like 0, or something else, but it isn't the numerical
value 0.
....

Picky: given all the other messages in this thread, it's nearly
certain the OP's A1 cell contains text rather than a numeric 0 or
nothing at all. However, if the cell contained a very small negative
numeric value, so small that it would display as 0, that would also
cause the LOOKUP formula to return #N/A.
 
(e-mail address removed) wrote...
This is exactly what my formula looks like:

=IF(Q2=0,"",CHOOSE(Q2,"Weekly","Monthly","Quarterly",
"Every Four Months","Semi Annually","Annually"))

Q2 is the field in my worksheet that I'm referencing to.
....

Try changing this to

=IF(N(Q2)=0,"",CHOOSE(Q2,"Weekly","Monthly","Quarterly",
"Every Four Months","Semi Annually","Annually"))
 
If this applies, as an added precaution, you might want to use Data
Validation to limit the choices of what can be entered in cell Q2 to 1 to 6
(right now you have 6 choices) or whatever highest number applies. Depending
on your preference or personality, this might be totally unnecessary.

Since CHOOSE only uses values from 1 to 254, it seems the number 0 shouldn't
be included among your choices.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top