How to Divide a Number With “Less Than” Sign?

March 4, 2009 by vba excel
Filed under: Excel Tips 
Sponsor

Excel Tips Question:

Please help me to do a calculation from number of conversions from ug –> mg in a column. Many of the numbers that I need to convert have a “less than” sign… ie <1 should convert to <0.001

Excel Tips Answer:

Well, a number with a < sign is not a valid number in Excel, it is a character. and if you are trying to convert it as in your title the result will not be a number either. To do what you subject line asks probably would require a VBA macro.

Here is a excel vba macro you could run against a select range of cell to convert them (only if the leading character is < )

Sub ConvertIt()
Dim cell As Range
Dim x As Integer
Dim First As Double
Dim Second As Double
For Each cell In Selection
If Left(cell, 1) = “<” Then
x = InStr(1, cell, “/”)
First = Mid(cell, 2, 1)
Second = Mid(cell, x + 1, 10)
cell = “<” & First / Second
End If
Next cell
End Sub

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • E-mail this story to a friend!
  • Live
  • MisterWong
  • Propeller
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb
  • Print this article!

Rate This Tips:

1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 2.00 out of 5)
Loading ... Loading ...


Incoming excel search terms

how to divide in excel,how to divide a number,how to divide in vba,how to divide numbers,divideformulas in excel,excel divide by limit,excel divide two cells,how to divede a number in a number,how to divide by numbers less than one,how to put divide in excel,vba divide by a number,visual basic divide two cells,,a number equals two divided by one less than the same number,add cells then divide by the number of cells,code for divide in excel,devide a number in excel,devide less than data in excel,devide number in excel,divede in excel,divide a number equal in vba,divide by numbers sign,divide formulas in excel,divide function excel,divide in excel formula,divide in excel visual basic integer,divide in vba,divide less than data in excel,divide number in macro,divide numbers macro,divide range vba,divide sign in excel macro,divide the numbers in macros,divide with excel date,divide with less than sign,divide xcel,dividing 2 numbers vba,dividing a cell by 1 in numbers,dividing a number into ranges excel,dividing less than sign,entering less than data on excel,exce lvba code divide number,excel add less than numbers,excel convert less than value from mg to ug,excel devide,excel devide a number in two cells,excel divide,excel divide by business days,excel divide column by a number put answer in next column,excel divide number amongst different cells



Related Excel Tips

Comments

2 Comments on How to Divide a Number With “Less Than” Sign?

  1. Maxx32 on Thu, 22nd Oct 2009 10:23 am
  2. Besides the paper though, nothing of use can be bought

  3. Sanjay on Thu, 11th Mar 2010 3:35 pm
  4. i want to calculate the age of a employee

    example

    birth date = 01/03/1972

    today = 30/04/2010

    age = 38years , 01 months & 29 days

    date= dd/mm/yyyy

Have another excel answer or questions for this problem ?
Feel free to post it here..