View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Biff
 
Posts: n/a
Default Convert feet/inches to decimal

Ok, just to give you an idea of how "brutal" this is:

Just for this single format:

1'-7 3/8"

Requires this formula: (it could be slightly reduced as I wrote it with the
intention of including all the possible formats)

=IF(ISNUMBER(FIND("'",A10)),LEFT(A10,FIND("'",A10)-1)*12,0)+IF(COUNT(FIND({"-","
"},A10))=2,MID(A10,FIND("-",A10)+1,FIND("
",A10)-1-FIND("-",A10)),0)+IF(COUNT(FIND({" ","/"},A10))=2,MID(A10,FIND("
",A10)+1,FIND("/",A10)-1-FIND("
",A10))/MID(A10,FIND("/",A10)+1,FIND("""",A10)-1-FIND("/",A10)),0)

A single formula that accounts for all the possible formats would be a real
nightmare! Which leads me to ask about ALL THE POSSIBLE formats. You listed
these:

2 1/2"
8"
10 1/2"
1'-7 3/8"


But I came up these:

1'-7 3/8"
1'-10"
1'
2 1/2"
8"
1/2"

How about if the measurement is one foot. Will that be entered as 12" or 1'
(as I have listed above) ?

Where do these values come from? Are they manually entered by a user? Are
they imported from some other app? Copy/pasted from a web site?

If you could enter each unit of measure into separate cells this would be a
piece of cake!

If they are from some other app and you can't parse them out, then.....

I would recommend a separate formula breaking each measure into a separate
cell then summing those cells together. For example, one cell to calculate
the feet, one cell for the whole inches and one cell for the fractional
inches. The formulas for the inches would still be kind of long and ugly!

There's just too many different formats to contend with!

Before I continue with this let me know what you think and let me know ALL
the possible formats. It can be done but it ain't easy.

Biff

"dingy101" wrote in message
...
No,

2 1/2"
8"
10 1/2"
1'-7 3/8"

These are the different configurations.

Gary

"Biff" wrote:

Is the format ALWAYS the same?

In other words, will there ALWAYS be some feet, some inches and some
fraction of an inch?

Biff

"dingy101" wrote in message
...
Is there a way to convert a value in a cell that is 2'-3 1/2" to a
decimal such as 27.5" ?

excel 2003 SP2

Thanks
Gary