Can you nest SUBSTITUTE in an IF syntax?

Nanaia

Active Member
Joined
Jan 11, 2018
Messages
304
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.
DRWFACETEXTJOIN
256.87525_6_875
2511.37525_11_375
18A3618A_36

<tbody>
</tbody>
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
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,214,412
Messages
6,119,369
Members
448,888
Latest member
Arle8907

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