+ Reply to Thread
Results 1 to 13 of 13

Dimension (volume) conversion from mm to in

  1. #1
    Registered User
    Join Date
    11-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Dimension (volume) conversion from mm to in

    Hi,

    I have several hundreds of product size / dimensions that are in 1 column under the following format:

    Height x Length x Width .... all in mm and need to convert to inches ... but that's not all:
    - Some cells are mixed, so instead of dimensions being in a single order such as HxLxW they can be a different order, like LxWxH or HxWxL, etc.
    - Some are with the following format: "211mm x 456mm x 422mm"

    This is a single problem but can see two separate issues here.

    I've tried a two-dimension solution:
    =LOOKUP(99^99,--LEFT(A1,ROW($A$1:$A$10)))&"x"&25.4*LOOKUP(99^99,--RIGHT(A1,ROW($A$1:$A$10)))/25.4

    which works well grabbing the "H" and the "W" of my original example, but cannot grab the 3rd dimension ...

    This initially seems a bit of a trivial issue but now I'm out of ideas and could truly use some help.

    Thanks,

    Rod

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,053

    Re: Dimension (volume) conversion from mm to in

    To best describe or illustrate your problem you would be better off attaching a dummy workbook. The workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Valued Forum Contributor
    Join Date
    05-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    354

    Re: Dimension (volume) conversion from mm to in

    may be

    = ROUND(LEFT(SUBSTITUTE(SUBSTITUTE(A2,"mm",""),"x",REPT(" ",100)),100)/25.4,2) & " x " & ROUND(MID(SUBSTITUTE(SUBSTITUTE(A2,"mm",""),"x",REPT(" ",100)),101,100)/25.4,2) & " x " & ROUND(RIGHT(SUBSTITUTE(SUBSTITUTE(A2,"mm",""),"x",REPT(" ",100)),100)/25.4,2)

    and copy down
    Regards,
    Vandan

  4. #4
    Registered User
    Join Date
    11-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Dimension (volume) conversion from mm to in

    Here is the example file, as you can see, there's a big mix of formats ... the intention then is on Column C to automatically convert to inches and maybe clean format too.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    05-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    354

    Re: Dimension (volume) conversion from mm to in

    very similar to my #3 above except it handles x, X and *

    =ROUND(LEFT(SUBSTITUTE(UPPER(SUBSTITUTE(A2,"mm","")),"X",REPT(" ",100)),100)/25.4,2) & " X " & ROUND(MID(SUBSTITUTE(UPPER(SUBSTITUTE(A2,"mm","")),"X",REPT(" ",100)),101,100)/25.4,2) & " x " & ROUND(RIGHT(SUBSTITUTE(UPPER(SUBSTITUTE(A2,"mm","")),"X",REPT(" ",100)),100)/25.4,2)

    HTH

  6. #6
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Dimension (volume) conversion from mm to in

    Hmm?
    This might be a good case for getting the MoreFunc Add-in, then you can use EVAL()

    This takes your text string directly to cubic inches
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Dimension (volume) conversion from mm to in

    Don't know what happened, but this should have been added to Post #6 ...

    See this workbook for two ways without the MoreFunc Add-in
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    11-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Dimension (volume) conversion from mm to in

    Marcol, for some reason the workbook is not working and getting a #NAME? error

  9. #9
    Registered User
    Join Date
    11-07-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Dimension (volume) conversion from mm to in

    Vandan, this worked like a charm! I need to make a few adjustments only.

    Now the 2nd part of the question, how I reorganize the dimensions .... this database classifies hundreds of computer monitors, the norm should be H x W x D, but as you can tell, some dimensions are in different orders.

    A few points for guidance:
    - D (depth) should be the smallest dimension
    - W (width) should be the largest dimension

  10. #10
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Dimension (volume) conversion from mm to in

    Quote Originally Posted by rodmanlab View Post
    Marcol, for some reason the workbook is not working and getting a #NAME? error
    This is because you don't have the MoreFunc Add-in.
    The other columns should be okay.

  11. #11
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Dimension (volume) conversion from mm to in

    It might be easier to use a User Defined Function (UDF)

    Put this in a Standard VBa Module
    Please Login or Register  to view this content.
    Use in Excel like so ...
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    When you open this attachment, allow macros.
    Attached Files Attached Files

  12. #12
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Dimension (volume) conversion from mm to in

    i dont think op wants cubic inches but just converted so it reads 10 X100 X 0.5 inches
    so using some ideas already posted to put in H W D order
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  13. #13
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Dimension (volume) conversion from mm to in

    @ Martin

    In Post #1 the OP seems to be trying to multiply three LOOKUP()s but can only get two.
    The thread title seems, to me, to indicate a volume is ultimately required.

    Maybe I'm reading things wrong, but it is not necessary to get each number first, then multiply them.

    [EDIT]
    Reading it again, maybe your right Martin.
    Last edited by Marcol; 11-09-2012 at 08:33 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1