Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
=LEFT(A1,LEN(A1)-2)+0
|
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
or
=LEFT(A1,FIND("oz)-1)+0 |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Trim function to remove blank spaces in Excel | Excel Discussion (Misc queries) | |||
How do I remove from excel automatic date function? | New Users to Excel | |||
How do I remove the 'end' function in Excel 2003? | Excel Worksheet Functions | |||
Is there a way to remove old cell format objects from Excel? | Excel Discussion (Misc queries) | |||
remove conditional format | Excel Worksheet Functions |