Converting Feet-Inches to Inches Excel - excel

Hi I have a large excel spreadsheet which contains heights of different athletes in the form of
6' 4.25"
6' 2.75"
I am stuck on trying to find a single formula that can convert all of these heights to strictly inches.
Any help would be greatly appreciated.

Because these are string text and not actual numbers we need to parse the data. The following will grab the parts of the string and convert to the number:
=LEFT(A1, FIND("'",A1)-1)*12 + MID(A1,FIND("'",A1)+1,LEN(A1)-FIND("'",A1)-1)

Here's a formula that handles feet and inches (5'10"), just feet (5'), just inches (60"), and a number representing inches (60). It's based on brettdj's version.
=IFERROR(IFERROR(CONVERT(LEFT(A1,FIND("'",A1)-1),"ft","in"),0)+IFERROR(SUBSTITUTE(RIGHT(A1,LEN(A1)-IFERROR(FIND("'",A1),0)),"""","")+0,0),A1)

Wanted to get CONVERT in there as it is an under-utilised function. Something like
=CONVERT(LEFT(A1,FIND("'",A1)-1),"ft","in")+SUBSTITUTE(RIGHT(A1,LEN(A1)-FIND("'",A1)),"""","")

You could have the input in feet in one cell (say E4) and the input in inches in another cell (say F4, next to it). You can get your result by having a third cell (G4) with this formula:
= SUM(E4 * 12) + F4

Related

Bond Price fraction convert to decimal 32nd excel formula

i am pretty sure a lot of people in capital market experience this :
use excel formular to convert fraction to decial in 32nd
i know most case we just divide last 2 digits decimal place by 32 for example:
100-160= 100+16/32=100.5
100-200=100+20/32=100.625
but if 3 decimal places : 99-226=99+(22+6/8)/32=99.7109375
how do we convert it to formula in excel , please help!!!!
Assuming a data setup like this where your Bond Prices are in column A and your formula for Decimal Conversion is in column B:
The formula in cell B2 and copied down is:
=LEFT(A2,FIND("-",A2)-1)+(MID(A2&"00",FIND("-",A2)+1,2)+MID(SUBSTITUTE(A2,"+",4)&"000",FIND("-",A2)+3,1)/8)/32
Alternative Using FilterXML() function
Adding a further column B with the following xml conversion
="<t><a>" &SUBSTITUTE(SUBSTITUTE(A2,"+","4"),"-","</a><b>")&"</b></t>"
you can calculate results in a next column via FilterXML() available in Excel 2013+:
=FILTERXML(B2,"//a")+(LEFT(TEXT(FILTERXML(B2,"//b"),"000"),2)+RIGHT(TEXT(FILTERXML(B2,"//b"),"000"),1)/8)/32
tl;tr - one column solution (just for fanatics)
Of course you could also force the xml base into one formula:
=FILTERXML("<t><a>" &SUBSTITUTE(SUBSTITUTE(A2,"+","4"),"-","</a><b>")&"</b></t>","//a") + (LEFT(TEXT(FILTERXML("<t><a>" &SUBSTITUTE(SUBSTITUTE(A2,"+","4"),"-","</a><b>")&"</b></t>","//b"),"000"),2)+RIGHT(TEXT(FILTERXML("<t><a>" &SUBSTITUTE(SUBSTITUTE(A2,"+","4"),"-","</a><b>")&"</b></t>","//b"),"000"),1)/8)/32

Excel auto convert cell values into Lakh decimal

I want to auto convert cell values to lakh(Indian Unit) decimal
1) 120212 to 1.20
2) 898982 to 8.98
Is this possible with format-cell?
If you just want the figures , then using the following formula will do it :
=ROUND(A1/100000,2)
where the value in A1 is , to take your own example , 12538746.
The result will be 125.39
A method would be to use the number format - 0.00,,%\% which does work but unfortunately adds percentage signs. This is because the commas devide by 1000 but percentages multiply by 100, so you need it to do the last devide.
You could hide the percentages by putting a carriage return in possibly, but that's probably your best bet with numberformats.
Type 100000 in a spare cell. Copy it and paste special on the value to be converted as lacs and select divide on that. Automatically the cells which has values will get converted to lacs.
Just go to Format-Format Cell-number-custom-type #.00, if u wanna add Zero before, eg 5000 to read as 0.05 instead of just .05 type 0#.00,
Type 100000 in a spare cell. Copy it and paste special on the value to be converted as lacs and select divide on that. Automatically the cells which has values will get converted to lacs.
It was i am looking for...

how to add zeros after numbers to get a fix length in EXCEL

I have 3 numbers in excel.
A1. 498
A2. 899
A3. 5209
I want the numbers as the followings:
B1. 49800
B2. 89900
B3. 52090
I am still finding the solutions via online but most of the resource is discussing about leading zeros.
Please, could you kindly give me any ideas? Thanks.
I hope this formula may be of some use:
=A1 & REPT("0"; 5 - LEN(A1))
Thought this does not set the format of the cell itself (which I doubt can be done as you are changing the value of the cell by adding the zeros)
The formula only works if you are dealing with numbers as text, so you may need to convert them to text in the formula (TEXT(A1; "0") instead of A1)
you can do this one quite easily without VBA - using an IF and the very handy REPT function:
=IF(LEN(H13)<5,H13&REPT(0,5-LEN(H13)),H13)
Essentially - if the length is less than 5 - you repeat 0 up to the amount of times that its missing.
Seems like simple math to me. Essentially you want to shift left (base 10) a certain number of times. We can do this by:
Calculate the ceiling of the base-10 logarithm of the value to get it's "length"
Subtract the result from the target "length" of 5, this is the number of places we want to shift
Take 10 to this power and multiply back by the value.
In other words, where x represents the value in column A you want to transform:
In Excel, this would be expressed as:
=A1*POWER(10,(5-CEILING(LOG10(A1),1)))

Excel formula to convert number to both feet and inches

I have a spreadsheet (excel 2010) where in column A I have a metric value (2413mm) and in column B I need a formula that will convert 2413mm to show the feet/inches in the following format (7' 11")
I can do this if I use 3 or 4 columns to first convert the 2413 to 7.9', then extract the feet and inches into two separate columns and finally concatenate the separate feet and inches into a final cell.
I'd really like to be able to do all this within one cell.
I notice that Gary's Student's answer will give you decimals in the inches - if you want the answer to the nearest inch try this version
=INT(ROUND(A1*0.03937,0)/12)&"' "&MOD(ROUND(A1*0.03937,0),12)&""""
With data in A1, in B1 enter:
=INT(CONVERT(A1,"mm","ft")) & " '" & 12*(CONVERT(A1,"mm","ft")-INT(CONVERT(A1,"mm","ft"))) & """"
I wrote a User Defined Function to deal with feet and inches once and for all. I've shared the code and a downloadable VBA module here:
https://engineerstoolkit.wordpress.com/2017/03/05/dealing-with-feet-and-inches-in-excel/
If you install that, you can display the result (to any precision you desire) using the formula:
=FtToString(A1/25.4/12) Dividing by 25.4 converts the millimeters to inches, and dividing again by 12 converts it to feet (which is the assumed input for my formula).

How to zero fill a number inside of an Excel cell

How do you zero fill a number to 10 positions inside an excel spreadsheet?
i.e. If cell A1 has 1234 how can cell A2 display 0000001234 (10 postions).
=TEXT(A1,"0000000000")
Not a programming question, really:
Select cells you want formatted in this way.
Right click and select "Format Cells..."
Select the "Number" Tag, and scroll down to "Custom" in the category list.
Type "0000000000" into the Type field.
Format>Cells...>Number>Custom>Type>0000000000
This formula is variable.
It checks the length of the value and add "0" in front
Now the lenght is 10. You can change it.
=REPT("0",10-LEN(A1))&A1
I know this is a pretty old post, but I've just came across the same problem while exporting a sql table to excel, and I found I very simple solution!
Just set the cell format to ' Custom' then type the amount of characters you want the final number to have;
In your case 10 positions '0000000000'
I don't usually reply to the stackoverflow's posts, so I don't have enought reputation to post images;
Something like the following.
right( "0000000000" & number, 10 )
Put 10 zeroes on the left, take the right-most 10 positions, whatever they turn out to be.
Also, you have
text( number, "0000000000" )
How to display full the number inside in excel workseet?
I.e cell A1 "2.40252E+13" how to display full number in A1 became "24025207702012"

Resources