+ Reply to Thread
Results 1 to 27 of 27

Feet and inches conversion error if no foot value.

  1. #1
    Registered User
    Join Date
    09-18-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    31

    Feet and inches conversion error if no foot value.

    Hello,

    I am using the below formula to take foot and inch measurements and round them to the nearest inch.

    I had to combine several formulas to get it to work, so I am sure it's probably more complicated than it needs to be.
    That said, I get an error of #value when there are no feet, only inches in the measurement column.

    Please Login or Register  to view this content.
    Here's what it does in the table:
    1'4.035" ===== 1'4"
    15'8.9" ===== 15'9"
    25'0" ===== 25'0"
    33'7.762" ===== 33'8"
    -41'7.73" ===== -41'8"
    54'9.21" ===== 54'9"
    -68'5.073" ===== -68'5"
    81'10.194"===== 81'10"
    10.398" ===== #VALUE!
    -5.035" ===== #VALUE!
    68'5.073" ===== 68'5"
    92'.398" ===== 92'0"

    My thanks and appreciation to anyone who can modify the formula to function properly when there is no footage present. Bonus points for reducing its complexity.

    File attached for reference.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Feet and inches conversion error if no foot value.

    Try

    =IFERROR(LEFT($A2,FIND("'",$A2)),"")&IFERROR(ROUND(SUBSTITUTE(TRIM(MID($A2,FIND("'",$A2)+1,255)),"""",""),0),ROUND(SUBSTITUTE($A2,"""",""),0)) & """"
    Last edited by JohnTopley; 07-30-2017 at 03:56 AM. Reason: Amended formula

  3. #3
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Feet and inches conversion error if no foot value.

    if 54'11.91" then 54'12", but right is 55'

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Feet and inches conversion error if no foot value.

    @tim: good catch!

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Feet and inches conversion error if no foot value.

    This will give result in Inches (in "helper" column ?)

    =IFERROR((LEFT($A2,FIND("'",$A2)-1)+0),0)*12+IFERROR(ROUND(SUBSTITUTE(TRIM(MID($A2,FIND("'",$A2)+1,255)),"""","")+0,0),ROUND(SUBSTITUTE($A2,"""","")+0,0))

    then

    =INT(result/12) for feet

    =MOD(result,12) for inches

    No simple formula.
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Feet and inches conversion error if no foot value.

    May be,

    =IFERROR(LEFT(A2,FIND("'",A2)-1),0)&"'"&ROUND(SUBSTITUTE(MID(A2,IFERROR(FIND("'",A2)+1,1),20),CHAR(34),"")+0,)&CHAR(34)
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  7. #7
    Registered User
    Join Date
    09-18-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    31

    Re: Feet and inches conversion error if no foot value.

    Quote Originally Posted by Haseeb A View Post
    May be,

    =IFERROR(LEFT(A2,FIND("'",A2)-1),0)&"'"&ROUND(SUBSTITUTE(MID(A2,IFERROR(FIND("'",A2)+1,1),20),CHAR(34),"")+0,)&CHAR(34)
    Thanks for your help guys. Haseeb is a step closer to what I am looking for. Only problem with this is that the negative measurements without footage show up as 0'-##" instead of -0'##"

    Any thoughts on this?

    Thanks again

    -A

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Feet and inches conversion error if no foot value.

    Will this work for you?

    =IFERROR(LEFT(A2,FIND("'",A2)-1),IF(LEFT(A2,1)="-","-0",0))&"'"&ABS(ROUND(SUBSTITUTE(MID(A2,IFERROR(FIND("'",A2)+1,1),20),CHAR(34),"")+0,))&CHAR(34)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  9. #9
    Registered User
    Join Date
    09-18-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    31

    Re: Feet and inches conversion error if no foot value.

    That is is!

    Thank you all for your help!

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Feet and inches conversion error if no foot value.

    You're welcome!

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  11. #11
    Registered User
    Join Date
    09-18-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    31

    Re: Feet and inches conversion error if no foot value.

    Yep! Solved indeed.

    Thanks!

  12. #12
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Feet and inches conversion error if no foot value.

    Try

    92'11.5"

    result

    92' 12"

    See post #3!

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Feet and inches conversion error if no foot value.

    Good point, John!!!

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Feet and inches conversion error if no foot value.

    How about this?

    =IFERROR(IF(ABS(ROUND(SUBSTITUTE(MID(A2,IFERROR(FIND("'",A2)+1,1),20),CHAR(34),"")+0,))=12,1,0)+LEFT(A2,FIND("'",A2)-1),IF(LEFT(A2,1)="-","-0",0))&"'"&IF(ABS(ROUND(SUBSTITUTE(MID(A2,IFERROR(FIND("'",A2)+1,1),20),CHAR(34),"")+0,))=12,0,ABS(ROUND(SUBSTITUTE(MID(A2,IFERROR(FIND("'",A2)+1,1),20),CHAR(34),"")+0,)))&CHAR(34)

  15. #15
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Feet and inches conversion error if no foot value.

    Hence my reply #5.

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Feet and inches conversion error if no foot value.

    See post #14.

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Feet and inches conversion error if no foot value.

    Actually, on reflection, I think it needs to be this:

    Please Login or Register  to view this content.
    which will take care of a value such as -11.935".

  18. #18
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Feet and inches conversion error if no foot value.

    @Ali: very good!!!

  19. #19
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Feet and inches conversion error if no foot value.

    Thanks, John!!! You'd think I'd got nothing better to do ... devil2.gif

  20. #20
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: Feet and inches conversion error if no foot value.

    .@Ali:..good brain training: plus you are a lady who likes a challenge!

  21. #21
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Feet and inches conversion error if no foot value.

    Yes, it certainly keeps the little grey cells active. Trouble is, it is addictive, and the ironing isn't going to do itself ... juggle.gif

  22. #22
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Feet and inches conversion error if no foot value.

    May be this,

    Please Login or Register  to view this content.

  23. #23
    Forum Expert tim201110's Avatar
    Join Date
    10-23-2011
    Location
    Russia
    MS-Off Ver
    2016, 2019
    Posts
    2,357

    Re: Feet and inches conversion error if no foot value.

    my two cents
    UDF can be understood more easily
    Please Login or Register  to view this content.
    Attached Files Attached Files

  24. #24
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Feet and inches conversion error if no foot value.

    Quote Originally Posted by Haseeb A View Post
    May be this,

    Please Login or Register  to view this content.
    Works, but does not return the format that the OP seems to want. For example, this:

    9'11.5"

    should become this:

    10'0"

    instead of this:

    10'

    It doesn't work for a value like -11.935" which should resolve to -1'0" (not 1'0").
    Last edited by AliGW; 07-30-2017 at 11:16 AM.

  25. #25
    Registered User
    Join Date
    09-18-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    31

    Re: Feet and inches conversion error if no foot value.

    I'm just getting back to this everyone, will report back shortly!

    Thanks for all your help!

  26. #26
    Registered User
    Join Date
    09-18-2015
    Location
    New York
    MS-Off Ver
    2013
    Posts
    31

    Re: Feet and inches conversion error if no foot value.

    Quote Originally Posted by AliGW View Post
    Actually, on reflection, I think it needs to be this:

    Please Login or Register  to view this content.
    which will take care of a value such as -11.935".
    I think Ali has done it (again!)

    Looks like everything is calculating correctly. Thank you so much for all your help!

  27. #27
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Feet and inches conversion error if no foot value.

    It was addictively fun - thank you!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Convert Feet and Inches (Fractions) to Decimal Feet
    By kellser in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-29-2022, 10:15 AM
  2. [SOLVED] Convert feet, inches, fractions to inches and decimals
    By bjohnsonac in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-03-2021, 12:08 PM
  3. [SOLVED] Conversion Feet&Inches to Inches
    By rakshith90 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-23-2017, 03:46 PM
  4. Length conversion from cms to feet and inches
    By JustWilliam in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 11-11-2016, 10:19 AM
  5. Convert feet and inches to decimal feet
    By hrg in forum Excel General
    Replies: 12
    Last Post: 04-11-2016, 05:19 PM
  6. Feet and Inches Conversion and Addition
    By eshman in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-22-2015, 03:48 PM
  7. Inches to Feet conversion
    By Beeler in forum Excel General
    Replies: 5
    Last Post: 04-24-2007, 12:39 PM

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