Unit awareness

kkjensen

Active Member
Joined
Jun 22, 2004
Messages
354
Hi there excelers...

I'm trying to make an engineering spreadsheet "unit aware" so the cells will contain Kg or lbs depending on what unit the client wants. Does anyone have any ideas on how to go about this in the best way.

I'm not expecting any miracles but I'm sure someone somewhere has had to deal with the same thing before.

thanks,
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Not too sure what you're after, but have a look at the CONVERT function. You could use data-->validation to give the user/s a list of to/from values from which to make the conversion.
 
Upvote 0
what I'm after...hmmm. Most of my clients come in with planes with handbooks written either in Imperial or Metric. I want to set up my spreadsheets so I can output both so there is no confusion.

Example: If i have inputs in inches (I'll select this from a dropdown list) and could use a concatenate to add "in" to the end of the number but then I couldn't really link to this cell very easily.

It be nice to see "1in. (0.0254m)" in the cell A1 (lets just say) and be able to have equation pointing at it in the regular A1+B1 way and not have to be perpetually concatenating and trim the string to get the number back out again or be losing precision to rounded numbers.
 
Upvote 0
I still think the CONVERT function is what you're looking for...
Book15
ABCD
1Input Value1
2Input Unitin
3Output Unitm
4Output Value0.0254
Sheet1
 
Upvote 0
If I were to do a custom format on B1 in your example at add so it were 0"in" is there a way to make an IF statement to detect the "in" and automatically select meters? I guess it would be something like:


=CUSTOMCONVERT(B1)
where: (pardon my humble VBA skills)
Code:
Function CUSTOMCONVERT(CELLREF As Variant)

' detect units used
If IsNumeric(Find("in", CELLREF)) Then
    Unit = "in"
ElseIf IsNumeric(Find("m", CELLREF)) Then
    Unit = "m"
End If
  
' select output units
If Unit = "m" Then
    outputunit = "in"
End If

If Unit = "in" Then
    outputunit = "m"
End If


CUSTOMCONVERT = CONVERT(CELLREF, Unit, outputunit)

End Function

...edited a few times...sorry if you see one with glaring mistakes...I typed it instead of copying and made some typos

Am I far off? It doesn't seem to be working and I'm pretty sure it's because it's not finding the unit since it's part of the format and not actually written in the cell. How can I look for the unit in the format?
 
Upvote 0
I use a DropDown in my Column Label and code that detects what that label is to adjust my column values!

Also:

Converts a number from one measurement system to another. For example, CONVERT can translate a table of distances in miles to a table of distances in kilometers.

If this function is not available, and returns the #NAME? error, install and load the Analysis ToolPak add-in.
 
Upvote 0

Forum statistics

Threads
1,225,608
Messages
6,185,960
Members
453,333
Latest member
BioCoder84

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top