Formula to pull numbers of a cell with a text string

Chards

New Member
Joined
Apr 2, 2020
Messages
4
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
Hi,

Is there a formula that will allow me to calculate a percentage from another cell that contains numbers and text?
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Please show us what a few examples of what this text string looks like and your expected results.
Please try to cover all possibilities in your example, so we can come up with a solution that will work not just for one example, but all your cases.
 
Upvote 0
Sorry, did not realize the attachment didn't load. Now attached. This should help provide some context.
 

Attachments

  • Excel question.jpg
    Excel question.jpg
    44.1 KB · Views: 3
Upvote 0
Try this, and format result as percent:
Excel Formula:
=TRIM(MID(A4,FIND(":",A4)+1,99))/TRIM(MID(A3,FIND(":",A3)+1,99))
 
Upvote 0
Thank you, that worked. Quick question - If the colon was not present in the text string, would the adjustment to the formula go from ":" to "" or take out the quotes entirely?
 
Upvote 0
Thank you, that worked. Quick question - If the colon was not present in the text string, would the adjustment to the formula go from ":" to "" or take out the quotes entirely?
No, that would not work.

If you had no colon (just a space), then as long as you only want the last value in the string, you could use this:
Excel Formula:
=TRIM(RIGHT(SUBSTITUTE(A4," ",REPT(" ",100)),100))/TRIM(RIGHT(SUBSTITUTE(A3," ",REPT(" ",100)),100))
 
Upvote 0

Forum statistics

Threads
1,215,219
Messages
6,123,684
Members
449,116
Latest member
HypnoFant

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