If Then Replace

mikeyates

New Member
Joined
Oct 17, 2023
Messages
23
Office Version
  1. 365
Platform
  1. Windows
I want to reference another cell, and if it has a certain value (only 5 options), then I want to output something else in it's stead.

So, for example, if 'Sheet2!A1=ABC, then instead of putting ABC, I want it to say XYZ

I created another sheet with the assigned co-values, if that helps. I thought I might could just point the reference to another reference, but I can't get the if then to work.

Is there another formula?

What am I missing?

Thanks in advance.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hard to say for sure without more detail. Look at the IFS function.

Hope that helps,

Doug
 
Upvote 0
Asking for additional clarification. Are you saying that if a cell contains the text "ABC" (not a formula) to overwrite it with "XYZ".
If so, that cannot be done with a formula. But it can be done with VBA.
 
Upvote 0
I found it. I wasn't using the IFs correctly. Thanks for the quick response. You guys are awesome.
 
Upvote 0
This was the final syntax that wound up solving everything, incase you were curious.

="<class catalognum="&CHAR(34)&IF('1. Registration'!A1="CCD",'14. Base Info'!B1,IF('1. Registration'!A1="MPDR",'14. Base Info'!B2,IF('1. Registration'!A1="CPD",'14. Base Info'!B3,IF('1. Registration'!A1="CFR",'14. Base Info'!B4,IF('1. Registration'!A1="NTA",'14. Base Info'!B5,IF('1. Registration'!A1="CYBER",'14. Base Info'!B6))))))&CHAR(34)
 
Upvote 0
Thanks, glad you got it working. The IFS functions might also work...

Doug
 
Upvote 0
Solution
Thanks, glad you got it working. The IFS functions might also work...

Doug
Oh. I didn't read your reply as IFS. I read it as IFs, as in multiple IF statements. I've never heard of IFS, but now I'm curious. Thanks for the tip. I'm still new at learning these things.
 
Upvote 0
Thanks, glad you got it working. The IFS functions might also work...

Doug
I had to do it again with different data, and the IFS worked a lot easier!

=IFS('8. Data Entry'!B6="Mike",'14. Base Info'!B8,'8. Data Entry'!B6="Sal",'14. Base Info'!B9,'8. Data Entry'!B6="Steve",'14. Base Info'!B10)
 
Upvote 0

Forum statistics

Threads
1,215,328
Messages
6,124,295
Members
449,149
Latest member
mwdbActuary

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
Back
Top