Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Is there a function or format to remove 'oz' from '12oz' in Excel?

I'm trying to see if there is a way to take another user's input of "12oz",
say in cell A1, and convert it to the numeric value of just '12' in another
cell, say B1, so I can use the numeric value for calculations?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Is there a function or format to remove 'oz' from '12oz' inExcel?

=LEFT(A1,LEN(A1)-2)+0
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Is there a function or format to remove 'oz' from '12oz' inExcel?

or
=LEFT(A1,FIND("oz)-1)+0
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Is there a function or format to remove 'oz' from '12oz' in Excel?

Hi,

If you don't want the 'oz' in the cell simply do an

Edit|Replace
enter oz
leave the replace with box blank

Or

=LEFT(A1,SEARCH("oz",A1)-1)+0

in another cell.

Mike

"Skip" wrote:

I'm trying to see if there is a way to take another user's input of "12oz",
say in cell A1, and convert it to the numeric value of just '12' in another
cell, say B1, so I can use the numeric value for calculations?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Is there a function or format to remove 'oz' from '12oz' in Ex

Thanks for your reply. I apologize for not being clearer. Absolutely my
fault. I am familiar with the edit/replace and left/mid/right functions, but
the spreadsheet I'm expecting back will have multiple rows of varying user
inputs. For instance, I could have over 400 rows, each with a different
value, such as 12oz, 120g, 1500mls, etc. There will not be any constant
length in either the number or text values, hence my question. Worse case,
I'll use the find/replace to strip off the alpha characters, but was hoping
Excel had a way of returning only the numeric values in this situation.

Skip

"Mike H" wrote:

Hi,

If you don't want the 'oz' in the cell simply do an

Edit|Replace
enter oz
leave the replace with box blank

Or

=LEFT(A1,SEARCH("oz",A1)-1)+0

in another cell.

Mike

"Skip" wrote:

I'm trying to see if there is a way to take another user's input of "12oz",
say in cell A1, and convert it to the numeric value of just '12' in another
cell, say B1, so I can use the numeric value for calculations?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 896
Default Is there a function or format to remove 'oz' from '12oz' in Ex

you might try to use the following macro (select yr data first, should
be stored in a column):

Sub cus()
For Each cell In Selection
cell.Offset(0, 1) = Val(cell)
Next cell
End Sub


HIH
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,651
Default Is there a function or format to remove 'oz' from '12oz' in Ex

On Wed, 20 Aug 2008 06:36:10 -0700, Skip
wrote:

Thanks for your reply. I apologize for not being clearer. Absolutely my
fault. I am familiar with the edit/replace and left/mid/right functions, but
the spreadsheet I'm expecting back will have multiple rows of varying user
inputs. For instance, I could have over 400 rows, each with a different
value, such as 12oz, 120g, 1500mls, etc. There will not be any constant
length in either the number or text values, hence my question. Worse case,
I'll use the find/replace to strip off the alpha characters, but was hoping
Excel had a way of returning only the numeric values in this situation.

Skip



=LOOKUP(9.9E+307,--MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},
A1&"0123456789")),ROW(INDIRECT("1:"&LEN(A1)))))

will return the numbers. You could then edit/copy edit/paste special/values
to eliminate the formula.
--ron
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default Is there a function or format to remove 'oz' from '12oz' in Ex

Thanks all for the different suggestions. These will keep me busy for a
while. :)

"Ron Rosenfeld" wrote:

On Wed, 20 Aug 2008 06:36:10 -0700, Skip
wrote:

Thanks for your reply. I apologize for not being clearer. Absolutely my
fault. I am familiar with the edit/replace and left/mid/right functions, but
the spreadsheet I'm expecting back will have multiple rows of varying user
inputs. For instance, I could have over 400 rows, each with a different
value, such as 12oz, 120g, 1500mls, etc. There will not be any constant
length in either the number or text values, hence my question. Worse case,
I'll use the find/replace to strip off the alpha characters, but was hoping
Excel had a way of returning only the numeric values in this situation.

Skip



=LOOKUP(9.9E+307,--MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},
A1&"0123456789")),ROW(INDIRECT("1:"&LEN(A1)))))

will return the numbers. You could then edit/copy edit/paste special/values
to eliminate the formula.
--ron

  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Is there a function or format to remove 'oz' from '12oz' in Ex

Maybe this,

Sub sonic()
For Each C In ActiveSheet.UsedRange
If Not C.HasFormula And Not IsNull(C) And Not IsEmpty(C) Then
C.Value = Val(C)
End If
Next
End Sub

Mike

"Skip" wrote:

Thanks for your reply. I apologize for not being clearer. Absolutely my
fault. I am familiar with the edit/replace and left/mid/right functions, but
the spreadsheet I'm expecting back will have multiple rows of varying user
inputs. For instance, I could have over 400 rows, each with a different
value, such as 12oz, 120g, 1500mls, etc. There will not be any constant
length in either the number or text values, hence my question. Worse case,
I'll use the find/replace to strip off the alpha characters, but was hoping
Excel had a way of returning only the numeric values in this situation.

Skip

"Mike H" wrote:

Hi,

If you don't want the 'oz' in the cell simply do an

Edit|Replace
enter oz
leave the replace with box blank

Or

=LEFT(A1,SEARCH("oz",A1)-1)+0

in another cell.

Mike

"Skip" wrote:

I'm trying to see if there is a way to take another user's input of "12oz",
say in cell A1, and convert it to the numeric value of just '12' in another
cell, say B1, so I can use the numeric value for calculations?

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Is there a function or format to remove 'oz' from '12oz' in Excel?

There is a function called EditReplace

Note: after you have removed "oz" and replaced with nothingyou will have to
format the cells as General.

Then...........Copy an empty cell.

Select the range of "numbers" and editpaste specialaddokesc.


Gord Dibben MS Excel MVP

On Wed, 20 Aug 2008 06:03:01 -0700, Skip
wrote:

I'm trying to see if there is a way to take another user's input of "12oz",
say in cell A1, and convert it to the numeric value of just '12' in another
cell, say B1, so I can use the numeric value for calculations?




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trim function to remove blank spaces in Excel Natty Excel Discussion (Misc queries) 1 June 26th 08 03:31 PM
How do I remove from excel automatic date function? Need Help New Users to Excel 2 September 14th 07 06:42 PM
How do I remove the 'end' function in Excel 2003? David R Excel Worksheet Functions 5 July 27th 07 09:36 PM
Is there a way to remove old cell format objects from Excel? DavidFarnsworth Excel Discussion (Misc queries) 0 January 13th 07 05:00 AM
remove conditional format T ROG Excel Worksheet Functions 4 March 30th 06 03:56 PM


All times are GMT +1. The time now is 04:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"