Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel : ignore letters in cell during calculation 4

Status
Not open for further replies.

Guthro

Technical User
Sep 9, 2006
107
GB
Assuming cell a1 = 40 and b1 = 70cl
How can I make a calculation with a result in c1 using the figures in a1 and b1 but ignore the letters "cl" in b1 ?

Thanks.



My Feeblegirl.com Forum boards for mmorpgs, sport, fun, politics...
 
Given the limit range of units you are likely to encounter another way would be to use substitute function to remove the unit of measure:
=VALUE(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,"ml",""),"cl",""),"l","")))

You could also use Edit, Replace to remove the unit of measure. Or to replace "cl" with " cl etc". Then use text to columns to split the number from the units as suggested by lionelhill.

Gavin
 
A star to Gavona, because his solution works even better than you'd think. If you substitute the exponentials for the appropriate units, his version can also convert your values to numbers in ml.

=VALUE(TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1,"ml",""),"cl","e+02"),"l","e+03")))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top