Not Getting Correct Result using =Substitute

RapchikM

Board Regular
Joined
Oct 5, 2020
Messages
88
Office Version
  1. 2021
Platform
  1. Windows
Hello

This is my text in Cell B21
Against completion of all GOVT. approval and submission of security for a period of 1 Year 5%

i used the following Formula in C21
=SUBSTITUTE(RIGHT(B21,COUNT(MID(B21,SEQUENCE(LEN(B21)),2)+0)),"%","",1)

Also tried
=SUBSTITUTE(RIGHT(B21,COUNT(MID(B21,SEQUENCE(LEN(B21)),2)+0)),"%","",2)

and
=SUBSTITUTE(RIGHT(B21,COUNT(MID(B21,SEQUENCE(LEN(B21)),2)+0)),"%","")


I get result as r 5. I dont understand Why ?


Can someone help me to remove r and Space before 5 it should display 5 only

Thanks
RapchikM
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
How about
Excel Formula:
=TEXTAFTER(B21," ",-1)*100
I would also suggest you update your profile as 2013 does not have the sequence function. ;)
 
Upvote 0
I would also suggest you update your profile as 2013 does not have the sequence function. ;)
Sir, Profile updated

No more now on Excel 2013

In Excel 2021 tried incorporating =TextAfter but does not pop up. Tried But Error Genrated #Name?
So any other Method

Thanks
RapchikM
 
Upvote 0
Excel Formula:
=TRIM(RIGHT(SUBSTITUTE(B21," ",REPT(" ",100)),100))*100
Yes Tried but Result Displays as 500% instead of 5

Tried following
=TRIM(RIGHT(SUBSTITUTE(B21," ",REPT(" ",100)),100))*1

Now displays as 5% instead of 5
RapchikM
 
Upvote 0
You said you wanted it to display 5 which is exactly what that does if you change the cell format to general.
 
Upvote 0
You said you wanted it to display 5 which is exactly what that does if you change the cell format to general.

Whether the Cell or Column Format when changed to General it displays as 0.05 It is Perfectly Fine for that Cell or Range of column with the Formula what we have incorporated

Moving Ahead Still Multiplying a value from Different Cell as per below

=TRIM(RIGHT(SUBSTITUTE(B15," ",REPT(" ",LEN(B21))),LEN(B21))*1

Thought of Replacing % to "" ---> this too did not work
=C$12 * REPLACE(TRIM(RIGHT(SUBSTITUTE(B21," ",REPT(" ",LEN(B21))),LEN(B21))*1),LEN(B15)-3,2," ")
OR
=C$12 * TRIM(RIGHT(SUBSTITUTE(B15," ",REPT(" ",LEN(B21))),LEN(B21))*1


Value of C12 = 1792350
The Result with above formula it comes as 8961750% instead of 89617.50
ie 5% of 1792350

RapchikM
 
Upvote 0
As noted, @Fluff's formula performed as originally noted. It can still work, actually returning the TEXT value of "5%" when the ending "*100" is removed from the formula, and when converted using VALUE returns 0.05
Excel Formula:
=VALUE(TRIM(RIGHT(SUBSTITUTE(B21," ",REPT(" ",100)),100)))
If that's what you need, the solution should go to @Fluff!
 
Upvote 0
Your formula is looking at B15, but using the length of B21.
Try
Excel Formula:
=C12*RIGHT(SUBSTITUTE(B21," ",REPT(" ",100)),100)
and format the cell as general not percentage
 
Upvote 0
Solution
Your formula is looking at B15, but using the length of B21.
Sorry for Typo Error

Thank you so much sir for your Efforts and Help

RapchikM
 
Upvote 0

Forum statistics

Threads
1,214,974
Messages
6,122,536
Members
449,088
Latest member
RandomExceller01

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