#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If statement

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?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default If statement

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

--
Gary''s Student - gsnu200760
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If statement

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?
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default If statement

=IF(A1=0,"",CHOOSE(A1,etc


--


Regards,


Peo Sjoblom


wrote in message
...
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?



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default If statement

=LOOKUP(A1,{0,1,2,3,4,5},{"","daily","weekly","mon thly","quarterly","annually"})


" wrote:

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?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If statement

I tried that but it didn't work. I showed my field with "0" as
"value##"

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default If statement

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


wrote in message
...
I tried that but it didn't work. I showed my field with "0" as
"value##"



  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If statement

That one returned "#N/A".

BTW, I'm using excel 97

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If statement

On Dec 5, 11:32 am, "Peo Sjoblom" wrote:
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.
  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 364
Default If statement

wrote in message
...
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.




  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If statement

On Dec 5, 11:44 am, "Stephen" <none wrote:
wrote in message

...

That one returned "#N/A".


BTW, I'm using excel 97


Which one? Of what?


=LOOKUP(A1,{0,1,2,3,4,5},
{"","daily","weekly","monthly","quarterly","ann ual-ly"}) Returned "#N/
A"


  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default If statement

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



" wrote:

That one returned "#N/A".

BTW, I'm using excel 97


  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default If statement

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


wrote in message
...
On Dec 5, 11:32 am, "Peo Sjoblom" wrote:
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.



  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 364
Default If statement

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.

wrote in message
...
On Dec 5, 11:44 am, "Stephen" <none wrote:
wrote in message

...

That one returned "#N/A".


BTW, I'm using excel 97


Which one? Of what?


=LOOKUP(A1,{0,1,2,3,4,5},
{"","daily","weekly","monthly","quarterly","ann ual-ly"}) Returned "#N/
A"




  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If statement

This is exactly what my formula looks like:

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

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

On Dec 5, 11:53 am, "Peo Sjoblom" wrote:
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

wrote in message

...



On Dec 5, 11:32 am, "Peo Sjoblom" wrote:
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.- Hide quoted text -


- Show quoted text -




  #16   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default If statement

"Stephen" <none wrote...
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.
  #17   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default If statement

wrote...
This is exactly what my formula looks like:

=IF(Q2=0,"",CHOOSE(Q2,"Weekly","Monthly","Quarter ly",
"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","Quart erly",
"Every Four Months","Semi Annually","Annually"))
  #18   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default If statement

It's working. There was an extra space in the cells.


Thanks everyone for your help.


On Dec 5, 12:18 pm, Harlan Grove wrote:
wrote...
This is exactly what my formula looks like:


=IF(Q2=0,"",CHOOSE(Q2,"Weekly","Monthly","Quarter ly",
"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","Quart erly",
"Every Four Months","Semi Annually","Annually"))


  #19   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 39
Default If statement

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.

" wrote:

It's working. There was an extra space in the cells.


Thanks everyone for your help.


On Dec 5, 12:18 pm, Harlan Grove wrote:
wrote...
This is exactly what my formula looks like:


=IF(Q2=0,"",CHOOSE(Q2,"Weekly","Monthly","Quarter ly",
"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","Quart erly",
"Every Four Months","Semi Annually","Annually"))



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
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM
IF statement? metalsped Excel Discussion (Misc queries) 2 June 8th 05 08:32 PM
If statement and Isblank statement Rodney C. Excel Worksheet Functions 0 January 18th 05 08:39 PM
Help please, IF statement/SUMIF statement Brad_A Excel Worksheet Functions 23 January 11th 05 02:24 PM


All times are GMT +1. The time now is 12:23 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"