I want brackets around my math equation answer?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am putting together a equipment table that has to have entries in metric. I
would like to set it up so that you type in the english units and it would
the convert into metric on the next line. However i have to have Brackets
around the Metric numbers...is there a way to do this?
 
You have failed to say which units you are working with but try this for inches
to centimeters.

In B1 enter =IF(A1="","",A1*2.54)

Drag/copy down column B

Format Column B to Custom (#,##0.00)

An event code solution if you wanted would be as follows...............

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in any cell in Col A
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 1 Then
n = Target.Row
If Excel.Range("A" & n).Value <> "" Then
Excel.Range("B" & n).Value = Excel.Range("A" & n).Value * 2.54
End If
End If
enditall:
Application.EnableEvents = True
End Sub

Format Column B to Custom (#,##0.00)


Gord Dibben MS Excel MVP


On Tue, 25 Jul 2006 11:55:03 -0700, Ms Serene <Ms
 
Martin's formula works fine for me assuming you want to convert imperial to
metric and also put parentheses around it. You must however have the Analysis
Toolpack add-In selected: Tools > Add-Ins > Analysis Toolpack checkbox

Regards,
Greg
 
Would you like to give us a clue by telling us what result you got?

Did you look up the CONVERT function in Excel help?

Did that give you an answer?

David Biddulph
 
You can format cells in Excell to display your data in any conceivable custom
format you want. Go to FORMAT, then CELLS, then CUSTOM. When you get to
that window enter the following "("##.## ")". The # signs refer to how many
digits and decimal places you want to show, so you may want something else
there. Anything that is enclosed by double quote marks will simply be
treated as a format. any numbers you then enter or calculate in a formatted
cell will display with brackets. I ofter format cells to read out with
attached words, such as 23.5 inches or 75 ohms, by putting the words "inches"
or "ohms" into the custom format window.
 
Back
Top