We'd like to remind Forumites to please avoid political debate on the Forum. This is to keep it a safe and useful space for MoneySaving discussions. Threads that are - or become - political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

excel formula not giving the correct answer

st999
st999 Posts: 1,574 Forumite
Part of the Furniture 1,000 Posts Name Dropper
I am trying to convert metres to feet and inches using excel.
If I convert 1.45 metres to feet and inches by multiplying 1.45*3.28 I get 4.76 and if I convert that to feet and inches using  =INT(F1)&"' "&TEXT(12*(F1-INT(F1)),"# #/#")&CHAR(34) I get 4' 9"
However the correct answer should be 4' 9 1/8" which you get if you use 4.76 instead of 1.45*3.28.

Why does multiplying 1.45 * 3.28 not give the same answer as using 4.76?
«13

Comments

  • theoretica
    theoretica Posts: 12,662 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    Look to your rounding and number of significant figures carefully.  1.45*3.28 is not exactly 4.76 for a start.
    4' 9 11/128 is closer
    But a banker, engaged at enormous expense,
    Had the whole of their cash in his care.
    Lewis Carroll
  • SalsaDanca
    SalsaDanca Posts: 434 Forumite
    Part of the Furniture 100 Posts
    edited 29 August 2020 at 2:35PM
    In the TEXT function, the formatting string "# #/#" will only display a fraction if the fraction has a 1-digit divisor (ie it will report 1/2 or 1/9, but not 1/10 or 1/12). You could try using "# #/12" which will force it to return a result to the nearest 12th of an inch, or "# #/#0" to return the correct result (in this case 9 1/14")
  • st999
    st999 Posts: 1,574 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    edited 29 August 2020 at 2:50PM
    Using  "# #/12" does give 4' 9 1/12" and  "# #/8" gives  4' 9 1/8" but how can I get 1.45 * 3.28 to equal the same 4.76 as 4.76 without altering the formula perhaps by formulating that cell in some way or is that not possible?
    Even copying the cell which contains 1.45*3.28 to another cell and using that does not give 
    4' 9 1/8"
    Or is this an excel bug?

  • st999
    st999 Posts: 1,574 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    I've just tried this in LibreOffice and the formula works as expected though giving the answer as 4' 9 1/9" which is probably more correct.
    Must be an excel bug
  • theoretica
    theoretica Posts: 12,662 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    1.45 x 3.28 = 4.756 so may not always give the same answer as running 4.76 through a formula.
    But a banker, engaged at enormous expense,
    Had the whole of their cash in his care.
    Lewis Carroll
  • debitcardmayhem
    debitcardmayhem Posts: 12,065 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    edited 29 August 2020 at 3:40PM
     little more correct is 4'9 +100000/114573" which is slightly less than 1/9th , Bored on a wet Saturday 1m~=3.28084 ft o:)
    4.8kWp 12x400W Longhi 9.6 kWh battery Giv-hy 5.0 Inverter, WSW facing Essex . Aint no sunshine ☀️ Octopus gas tracker 12/2023 + Octopus Flux
  • st999
    st999 Posts: 1,574 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    even multiplying 1.45 * 3.28084 still gives  4' 9"
  • debitcardmayhem
    debitcardmayhem Posts: 12,065 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    no it gives 4'9.086616"

    4.8kWp 12x400W Longhi 9.6 kWh battery Giv-hy 5.0 Inverter, WSW facing Essex . Aint no sunshine ☀️ Octopus gas tracker 12/2023 + Octopus Flux
  • First decide what precision you want. e.g. to nearest 1/8". Then if 1.45 in cell A1:
    A2 =8*CONVERT(A1,"m","in") gives 456.69 (1/8th of inches)
    A3 =INT(A2/96) gives 4 (feet)
    A4 =INT((A2-A3*96)/8) gives 9 (inches)
    A5 =INT(0.5+A2-A3*96-A4*8) gives 1 (nearest 1/8inch)
    With some effort may be possible to combine into single formula.
  • Stompa
    Stompa Posts: 8,351 Forumite
    Part of the Furniture 1,000 Posts Name Dropper
    First decide what precision you want. e.g. to nearest 1/8". Then if 1.45 in cell A1:
    A2 =8*CONVERT(A1,"m","in") gives 456.69 (1/8th of inches)
    A3 =INT(A2/96) gives 4 (feet)
    A4 =INT((A2-A3*96)/8) gives 9 (inches)
    A5 =INT(0.5+A2-A3*96-A4*8) gives 1 (nearest 1/8inch)
    With some effort may be possible to combine into single formula.
    Though if you have 1.473 in A1 you get 4' 9 8/8". Whilst you could argue that that is correct, it's an odd way of writing it!
    Stompa
Meet your Ambassadors

Categories

  • All Categories
  • 347.2K Banking & Borrowing
  • 251.6K Reduce Debt & Boost Income
  • 451.8K Spending & Discounts
  • 239.5K Work, Benefits & Business
  • 615.4K Mortgages, Homes & Bills
  • 175.1K Life & Family
  • 252.8K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 15.1K Coronavirus Support Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.