#1   Report Post  
steve
 
Posts: n/a
Default feet and inches

i know there are a lot of posts and things on feet and inches. my question
is a little more specific. i want the format to be (for 11 feet 6 inches) to
look like 11-6. so far, my formulas look like this:

this formula would convert 11-6 to 11.6 feet
=IF(F4=0,0,LEFT(F4,FIND("-",F4)-1)+((MID(F4,FIND("-",F4)+1,LEN(F4)))/12))

then this formula converts it back to 11-6
=CONCATENATE(LEFT(AC4,FIND(".",AC4)-1),"-",ROUND(((MID(AC4,FIND(".",AC4),LEN(AC4))))*12 ,1))

the problem i am having is that if it is 11-0, the second formula returns an
error. i think it is because it can't FIND the "."

i would appreciate any help.

Steve
  #2   Report Post  
steve
 
Posts: n/a
Default

i understand why it doesn't work. if you type 6.00 into a cell, the formula
bar still only reads 6

In other words, it rounds itself in the formula bar. how can i correct this?

thanks
steve

"steve" wrote:

i know there are a lot of posts and things on feet and inches. my question
is a little more specific. i want the format to be (for 11 feet 6 inches) to
look like 11-6. so far, my formulas look like this:

this formula would convert 11-6 to 11.6 feet
=IF(F4=0,0,LEFT(F4,FIND("-",F4)-1)+((MID(F4,FIND("-",F4)+1,LEN(F4)))/12))

then this formula converts it back to 11-6
=CONCATENATE(LEFT(AC4,FIND(".",AC4)-1),"-",ROUND(((MID(AC4,FIND(".",AC4),LEN(AC4))))*12 ,1))

the problem i am having is that if it is 11-0, the second formula returns an
error. i think it is because it can't FIND the "."

i would appreciate any help.

Steve

  #3   Report Post  
Bernard Liengme
 
Posts: n/a
Default

Say you have 4.5 in A1 then =INT(A1) returns 4 while =MOD(A1,1) returns 0.5
If A1 has 5, then you get 5 and 0, respectively
So =INT(A1)&"-"&MOD(A1,1) would seem to do what you want but it give 4-0.5
This works better =TEXT(INT(A1),"###")&"-"&TEXT(MOD(A1,1)*10,"0")
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"steve" wrote in message
...
i understand why it doesn't work. if you type 6.00 into a cell, the
formula
bar still only reads 6

In other words, it rounds itself in the formula bar. how can i correct
this?

thanks
steve

"steve" wrote:

i know there are a lot of posts and things on feet and inches. my
question
is a little more specific. i want the format to be (for 11 feet 6
inches) to
look like 11-6. so far, my formulas look like this:

this formula would convert 11-6 to 11.6 feet
=IF(F4=0,0,LEFT(F4,FIND("-",F4)-1)+((MID(F4,FIND("-",F4)+1,LEN(F4)))/12))

then this formula converts it back to 11-6
=CONCATENATE(LEFT(AC4,FIND(".",AC4)-1),"-",ROUND(((MID(AC4,FIND(".",AC4),LEN(AC4))))*12 ,1))

the problem i am having is that if it is 11-0, the second formula returns
an
error. i think it is because it can't FIND the "."

i would appreciate any help.

Steve



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Special format for feet - inches in a cell Bothell John Excel Discussion (Misc queries) 1 September 8th 05 12:28 AM
is there a macro that will convert from inches to feet and inches cable guy Excel Discussion (Misc queries) 1 June 20th 05 07:29 PM
Calculating the Area of objects in Feet and Inches Sip8316 Excel Discussion (Misc queries) 7 May 23rd 05 09:19 PM
How can I show Feet and inches in a Excel cell? Magama13 Excel Discussion (Misc queries) 1 January 28th 05 03:27 PM
Converting inches to feet & inches. svech61 Excel Worksheet Functions 2 November 27th 04 04:23 AM


All times are GMT +1. The time now is 12:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"