Assign a number to a text string.

jimleslie77

New Member
Joined
Sep 27, 2006
Messages
5
In an excel spread sheet if I type in the word "work" in col a row b, can that automatically assign the number "8" to col b row b. If so how do I do this?

Thanks
Jim
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

NBVC

Well-known Member
Joined
Aug 31, 2005
Messages
5,828
Like this?

in B2, enter =IF(A2="work",8,"")
 

Oaktree

MrExcel MVP
Joined
Jun 20, 2002
Messages
8,010
Office Version
  1. 365
Welcome to the board.

Not to sure what you mean by
col a row b
, but try setting B1 = IF(A1="Work",8,"") and copying the formula down.
 

Richard Schollar

MrExcel MVP
Joined
Apr 19, 2005
Messages
23,707
Hi Jim

Welcome to the Board!

Just to expand on NBVC's suggestion, if you have multiple possibilities ie Work=8, Play=6, Hiking=10 etc then you might like to use VLOOKUP instead. Eg in B2:

=VLOOKUP(A2,$D$1:$E$3,2,0)

Where D1:D3 holds Work, Play, Hiking and E1:E3 holds 8,6,10.

Best regards

Richard
 

jimleslie77

New Member
Joined
Sep 27, 2006
Messages
5
Ive been trying for ages to get this sorted, thanks so much to you all for all your help.
 

Forum statistics

Threads
1,136,649
Messages
5,676,991
Members
419,667
Latest member
MegEri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top