Summary

To convert a measurement in inches to inches and feet (i.e. 53 inches to 4' 5") you can use a formula based on the INT and MOD functions. In the example shown, the formula in D5 is:

=INT(B5/12)&"' "&MOD(B5,12)&""""

As the formula is copied down, it converts the inches in column B to feet and inches. Note that the result is a text string, since we need to embed single (') and double (") quotes. 

Generic formula

=INT(A1/12)&"' "&MOD(A1,12)&""""

Explanation 

In this example, the goal is to create a formula that converts a numeric value in inches to a format that displays inches and feet, as seen in the table below:

Input Output
9 0' 9"
12 1' 0"
30 2' 6"
75 6' 3"

The math for this problem is fairly simple, but the problem is more complex because we need to assemble a text string that includes a single quote for feet (') and a double quote (") for inches. This means we need to concatenate numbers after we perform the necessary calculations. The article below explains a basic formula for positive inputs with several variations. It also includes an adjusted formula to handle negative inches and a more modern formula based on the LET function.

Basic formula

In the worksheet shown above, the formula in cell D5 looks like this:

=INT(B5/12)&"' "&MOD(B5,12)&""""

This formula converts a numeric value in inches to text representing the same measurement in inches and feet. To get a value for feet, the INT function is used like this:

=INT(B5/12) // get whole feet

Inside INT, the value in B5 is divided by 12. The INT function returns the integer portion of a decimal number and discards any decimal remainder. The result from INT is the number of whole feet in B5. To get a value for inches, we use the MOD function like this:

MOD(B5,12) // get inches

The MOD function divides B5 by 12 and returns the remainder, which corresponds to inches.  At this point, we have a number for feet and a number for inches. The remaining task is to concatenate these numbers together into a text string that includes a single quote for feet (') and a double quote (") for inches. We start by adding a single quote with a space to the value for feet:

=INT(B5/12)&"' "

We add a space to separate the feet from the inches. Then we insert another ampersand (&) and add the MOD part of the formula:

=INT(B5/12)&"' "&MOD(B5,12)

We finish with two sets of double quotes (""""):

=INT(B5/12)&"' "&MOD(B5,12)&""""

The outer pair of double quotes tells Excel this is a text value. The inner pair of quotes causes Excel to return one double quote ("). Finally, all values are concatenated together, and Excel returns a result.

Rounded inches

To round inches to a given number of decimal places, wrap the MOD function in the ROUND function. For example, to round inches to one decimal:

=INT(A1/12)&"' "&ROUND(MOD(A1,12),1)&""""

With complete labels

To output a value like "8 feet 4 inches", you can adapt the formula like this:

=INT(B5/12)&" feet "&MOD(B5,12)&" inches"

Negative numbers

We need a different formula to work with negative inches as an input. One solution is to use a formula like this:

=REPT("-",B5<0)&INT(ABS(B5)/12)&"' "&MOD(ABS(B5),12)&""""

This looks pretty complicated, but the core of this formula is almost the same as the original formula above. The difference is that we are using the ABS function to convert the input in cell B5 to a positive number. This needs to happen twice, each time we use B5:

=INT(ABS(B5)/12)&"' "&MOD(ABS(B5),12)&""""

After ABS runs, the formula works as before and returns a text string indicating feet and inches. The remaining step is to add a negative sign ("-") if the input is indeed negative. We do this with the REPT function at the start of the formula. REPT is designed to repeat text values by providing a number for the second argument, for example:

=REPT("A",1) // returns "A"
=REPT("A",2) // returns "AA"
=REPT("A",3) // returns "AAA"

In our formula, we use REPT in a tricky way like this:

=REPT("-",B5<0)

When B5 is less than zero, the result is TRUE, which evaluates to 1. When B5 is not less than zero, the result is FALSE, which evaluates to 0. The REPT function only returns "-" when the value is negative, otherwise it returns an empty string. Essentially, the REPT formula mimics this longer IF formula:

 =IF(B5<0,"-","")

The final formula looks like this:

=REPT("-",B5<0)&INT(ABS(B5)/12)&"' "&MOD(ABS(B5),12)&""""

Formula adjusted to handle negative inputs

This formula will now correctly handle positive or negative input values.

Note: one reason we need to deal with negative numbers differently is that the INT function, contrary to its name, actually rounds negative numbers down away from zero. Another approach would be to switch to the TRUNC function, which just chops off the decimal value and keeps the integer with the sign. I tried that at first, but in the end I decided it made more sense to leave the original formula logic intact and treat the negative sign as a separate step. 

LET formula option

A problem like this is a perfect candidate for the LET function, which makes it possible to assign variables inside a formula. Using LET, we can write an all-in-one formula like this:

=LET(
input,ABS(B5),
sign,IF(B5<0,"-",""),
feet,INT(input/12),
inches,MOD(input,12),
sign&feet&"' "&inches&"""")

This may look more complicated at first glance, but if you look closely, you will see that the first four lines create variables (input, sign, feet, inches) in a logical order. The last line concatenates the sign, feet, and inches together and returns the result. We only need to use the ABS function once. This formula will handle positive or negative inputs.

This version of the formula does not use the REPT trick for the sake of readability, but it could.

Dave Bruns Profile Picture

AuthorMicrosoft Most Valuable Professional Award

Dave Bruns

Hi - I'm Dave Bruns, and I run Exceljet with my wife, Lisa. Our goal is to help you work faster in Excel. We create short videos, and clear examples of formulas, functions, pivot tables, conditional formatting, and charts.