Formula for keeping "3.99" from values with "4.99 (3.99 CMP)" ?

texhorn92

New Member
Joined
Jul 1, 2017
Messages
10
Hi,

I am working with numerous columns with values such as "4.99 (2.99 CMP)", "3.99 (2.99 CMP)", "2.99 (1.99 CMP)"

I am trying to come up with a formula that keeps the information in the parenthesis, excluding the " CMP".

For example, if we have the following info: 4.99 (3.99 CMP)

I want to keep: 3.99

The way I have been approaching this is using a mid formula that keeps the information in the parenthesis, (3.99 CMP) and then perform a search/replace to remove " CMP", which gives me the 3.99. Is there a formula that makes this more efficient and eliminates the need for using search/replace?

Thanks!
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Welcome to the forum.

I don't know what your formula looks like, but the shortest I could come up with looks like this:

=-SUBSTITUTE(MID(A1,FIND(" ",A1),99),"CMP","")
 
Upvote 0
If the value will always be x.xx, you could also use
=MID(A15,FIND("(",A15)+1,4)
If you need the answer to b a value
=--MID(A15,FIND("(",A15)+1,4)
 
Upvote 0
Changing FDibbins' formula slightly would catch everything up to xx.xx (assuming there is always a space before "CMP"):

=--MID(A15,FIND("(",A15)+1,5)
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,242
Members
452,623
Latest member
russelllowellpercy

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