Can you nest SUBSTITUTE in an IF syntax?

Nanaia

Active Member
Joined
Jan 11, 2018
Messages
306
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
Is it possible to nest SUBSTITUTE within an IF formula? I have a column that has a range of numbers in it that I want to combine in a TEXTJOIN string. However IF the number is a decimal, I need to substitute the decimal with an underscore. i.e. instead of 6.875 it needs to be 6_875. I'm not sure how to do it though. Can anyone help?
Thanks.

If you want more details, just let me know.
[TABLE="width: 500"]
<tbody>[TR]
[TD]DRW[/TD]
[TD]FACE[/TD]
[TD]TEXTJOIN[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]6.875[/TD]
[TD]25_6_875[/TD]
[/TR]
[TR]
[TD]25[/TD]
[TD]11.375[/TD]
[TD]25_11_375[/TD]
[/TR]
[TR]
[TD]18A[/TD]
[TD]36[/TD]
[TD]18A_36[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
bharrii - this brought me very close to what I wanted, however I needed an underscore between the DRW and the FACE as well as where the decimal is. Thank you for your help though!
 
Upvote 0
AlKey - you gave me the idea to just plug the substitute into my TEXTJOIN formula again. I tried it without the IF portion and it worked! I must've been over thinking it. (Go figure) Thanks for your help!
 
Upvote 0
bharrii - this brought me very close to what I wanted, however I needed an underscore between the DRW and the FACE as well as where the decimal is. Thank you for your help though!

To add the underscore:
Code:
=Concatenate(DRW, "_", Substitute(FACE, ".", "_"))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,169
Members
453,021
Latest member
Justyna P

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