ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Find and Replace/Substitute Formulas (https://www.excelbanter.com/excel-worksheet-functions/213364-find-replace-substitute-formulas.html)

Kathy123

Find and Replace/Substitute Formulas
 
Hi - I am trying to have my spreadsheet either replace numbers with a
corresponding name, or, if it's easier, add a column with a name. That is, I
have the following data:

123
345
357

I want my spreadsheet to either:
1. Replace 123 with Bob, and replace 345 with Jane, and replace 357 with
David. The result would be
Bob
Jane
David

Or

2. Add in a column so that the result is -
123 Bob
345 Jane
357 David

Is there a way for me to do either of these"

Thanks

Pete_UK

Find and Replace/Substitute Formulas
 
If you set up a table somewhere like this:

123 Bob
345 Jane
357 David

(suppose this is in X1:Y3), then you could use this formula in B1:

=IF(B1="","",VLOOKUP(A1,X$1:Y$3,2,0))

and then copy that down as required.

Hope this helps.

Pete

"Kathy123" wrote in message
...
Hi - I am trying to have my spreadsheet either replace numbers with a
corresponding name, or, if it's easier, add a column with a name. That
is, I
have the following data:

123
345
357

I want my spreadsheet to either:
1. Replace 123 with Bob, and replace 345 with Jane, and replace 357 with
David. The result would be
Bob
Jane
David

Or

2. Add in a column so that the result is -
123 Bob
345 Jane
357 David

Is there a way for me to do either of these"

Thanks




Kathy123

Find and Replace/Substitute Formulas
 
Thanks so much! This helps a lot.

"Pete_UK" wrote:

If you set up a table somewhere like this:

123 Bob
345 Jane
357 David

(suppose this is in X1:Y3), then you could use this formula in B1:

=IF(B1="","",VLOOKUP(A1,X$1:Y$3,2,0))

and then copy that down as required.

Hope this helps.

Pete

"Kathy123" wrote in message
...
Hi - I am trying to have my spreadsheet either replace numbers with a
corresponding name, or, if it's easier, add a column with a name. That
is, I
have the following data:

123
345
357

I want my spreadsheet to either:
1. Replace 123 with Bob, and replace 345 with Jane, and replace 357 with
David. The result would be
Bob
Jane
David

Or

2. Add in a column so that the result is -
123 Bob
345 Jane
357 David

Is there a way for me to do either of these"

Thanks




xlm

Find and Replace/Substitute Formulas
 
In case you did not set up a table, try this formula
assuming your data is in col A, place it in col B

=IF(A1=123,"bob",IF(A1=345,"Jane",IF(A1=357,"David ","not found")))

Hope this help

--
If this posting was helpful, please click on the Yes button

Thank You

cheers,









"Kathy123" wrote:

Hi - I am trying to have my spreadsheet either replace numbers with a
corresponding name, or, if it's easier, add a column with a name. That is, I
have the following data:

123
345
357

I want my spreadsheet to either:
1. Replace 123 with Bob, and replace 345 with Jane, and replace 357 with
David. The result would be
Bob
Jane
David

Or

2. Add in a column so that the result is -
123 Bob
345 Jane
357 David

Is there a way for me to do either of these"

Thanks


Pete_UK

Find and Replace/Substitute Formulas
 
You're welcome, Kathy - thanks for feeding back.

Pete

"Kathy123" wrote in message
...
Thanks so much! This helps a lot.





All times are GMT +1. The time now is 04:55 AM.

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