ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If Then assistance... (https://www.excelbanter.com/excel-worksheet-functions/170142-if-then-assistance.html)

Murph

If Then assistance...
 
I'm just not computing this simply in my mind. I want a formula/macro that
will check cell F2 for multiple terms (blue, red, green, yellow) then input a
number in cell G2 to reflect that color (blue = 1, red = 2, green = 3, yellow
= 4).

I have not had enough coffee today obviously because this seems like a
simple task and I'm just not grasping it. Excel 07 also.

Rick Rothstein \(MVP - VB\)

If Then assistance...
 
I think you are looking for this...

=MATCH(F2,{"blue","red","green","yellow"},0)

Rick


"Murph" wrote in message
...
I'm just not computing this simply in my mind. I want a formula/macro that
will check cell F2 for multiple terms (blue, red, green, yellow) then
input a
number in cell G2 to reflect that color (blue = 1, red = 2, green = 3,
yellow
= 4).

I have not had enough coffee today obviously because this seems like a
simple task and I'm just not grasping it. Excel 07 also.



Marcelo

If Then assistance...
 
Hy Murph,

if you have on cell F2 the text blue, red, yeloow etc

you can use +if(f2="Blue",1,if(f2="red",2,if(f2="green",3,if(f 2="yellow",4))))

if you are looking fot a value regarding the pattern of the cell, look at a
Chip Pearson page at:
http://www.cpearson.com/excel/SortByColor.htm

hth
--
regards from Brazil
Thanks in advance for your feedback.
Marcelo



"Murph" escreveu:

I'm just not computing this simply in my mind. I want a formula/macro that
will check cell F2 for multiple terms (blue, red, green, yellow) then input a
number in cell G2 to reflect that color (blue = 1, red = 2, green = 3, yellow
= 4).

I have not had enough coffee today obviously because this seems like a
simple task and I'm just not grasping it. Excel 07 also.


Don Guillett

If Then assistance...
 
You might try the help index for
LOOKUP.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Murph" wrote in message
...
I'm just not computing this simply in my mind. I want a formula/macro that
will check cell F2 for multiple terms (blue, red, green, yellow) then
input a
number in cell G2 to reflect that color (blue = 1, red = 2, green = 3,
yellow
= 4).

I have not had enough coffee today obviously because this seems like a
simple task and I'm just not grasping it. Excel 07 also.



CLR

If Then assistance...
 
The VLOOKUP function will do this nicely. Create a table, listing the colors
down one column and the corresponding numbers in the cells in the column just
to the right of it. Name the table "MyColors". Then put this formula in
cell G2

=VLOOKUP(F2,MyColors,2,FALSE)

Vaya con Dios,
Chuck, CABGx3




"Murph" wrote:

I'm just not computing this simply in my mind. I want a formula/macro that
will check cell F2 for multiple terms (blue, red, green, yellow) then input a
number in cell G2 to reflect that color (blue = 1, red = 2, green = 3, yellow
= 4).

I have not had enough coffee today obviously because this seems like a
simple task and I'm just not grasping it. Excel 07 also.


Mike H

If Then assistance...
 
Maybe
=LOOKUP(E2,{"Blue","Red","Green","Yellow"},{1,2,3, 4})
Mike


"Murph" wrote:

I'm just not computing this simply in my mind. I want a formula/macro that
will check cell F2 for multiple terms (blue, red, green, yellow) then input a
number in cell G2 to reflect that color (blue = 1, red = 2, green = 3, yellow
= 4).

I have not had enough coffee today obviously because this seems like a
simple task and I'm just not grasping it. Excel 07 also.


Ron Coderre

If Then assistance...
 
This formula returns the number index of the color in F2
.....or zero if F2 is either blank or contains invalid text:

G2: =MAX(COUNTIF(F2,{"blue","red","green","yellow"})*{ 1,2,3,4})

Does that help?
--------------------------

Regards,

Ron
Microsoft MVP (Excel)
(XL2003, Win XP)

"Murph" wrote in message
...
I'm just not computing this simply in my mind. I want a formula/macro that
will check cell F2 for multiple terms (blue, red, green, yellow) then
input a
number in cell G2 to reflect that color (blue = 1, red = 2, green = 3,
yellow
= 4).

I have not had enough coffee today obviously because this seems like a
simple task and I'm just not grasping it. Excel 07 also.





All times are GMT +1. The time now is 01:35 AM.

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