ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   if...or...Function (https://www.excelbanter.com/excel-discussion-misc-queries/17740-if-function.html)

Mgt

if...or...Function
 
I need to create a function that says:

If cell x is either 2,4,6,or 8, then type 'blue' in cell y
and if cell x is either 1,3,5 or 7, then enter 'yellow' in cell y
and if cell x is either 10,12,14,or 16, then enter 'green' in cell y
etc....



Don Guillett

If vba use SELECT CASE
select case =cell x
case =1,3,5,7: mc=yellow
case=2,etc
case else
end select
cell y=mc

--
Don Guillett
SalesAid Software

"Mgt" wrote in message
...
I need to create a function that says:

If cell x is either 2,4,6,or 8, then type 'blue' in cell y
and if cell x is either 1,3,5 or 7, then enter 'yellow' in cell y
and if cell x is either 10,12,14,or 16, then enter 'green' in cell y
etc....





Mgt

I guess I need more info (sorry)
what is vba?
how do I select case--I can't find this option in Excel....

"Don Guillett" wrote:

If vba use SELECT CASE
select case =cell x
case =1,3,5,7: mc=yellow
case=2,etc
case else
end select
cell y=mc

--
Don Guillett
SalesAid Software

"Mgt" wrote in message
...
I need to create a function that says:

If cell x is either 2,4,6,or 8, then type 'blue' in cell y
and if cell x is either 1,3,5 or 7, then enter 'yellow' in cell y
and if cell x is either 10,12,14,or 16, then enter 'green' in cell y
etc....







All times are GMT +1. The time now is 11:28 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com