length formula

hennahairgel

Board Regular
Joined
Feb 19, 2002
Messages
63
I have some formula in cells which I from an output file, and I am using Excel to work with results.
The problem is the output file generates results in the format of one letter and then five letters or numbers ie C12345 or F4567U. My problem comes when the first number is zero ie E09876, excel truncates it to E9876. I the #NAME? error by getting is to put everything as ="G45678", however I'm still stuck with the lost '0'.
Is there a way of looking at the length of a formula in a cell, and if it is too short inserting a zero in a relevant position?
TIA
Henry
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
On 2002-02-28 08:49, hennahairgel wrote:
I have some formula in cells which I from an output file, and I am using Excel to work with results.
The problem is the output file generates results in the format of one letter and then five letters or numbers ie C12345 or F4567U. My problem comes when the first number is zero ie E09876, excel truncates it to E9876. I the #NAME? error by getting is to put everything as ="G45678", however I'm still stuck with the lost '0'.
Is there a way of looking at the length of a formula in a cell, and if it is too short inserting a zero in a relevant position?
TIA
Henry

Evening Henry,

I'm a bit confused with your description of the problem.

the =g45678 is an instruction to tell Excel to read the cell in row 45678 intersected by column G

also, Excel actually truncates E09876 to E9876 ? I may be a million miles away but it sounds like it's trying to interpret this as a scientific format (ie 1.23E89, itself a big number) where nE9876 would be a number bigger than Imelda Marcos's total shoe inventory (!)
 
Upvote 0
On 2002-02-28 08:49, hennahairgel wrote:
I have some formula in cells which I from an output file, and I am using Excel to work with results.
The problem is the output file generates results in the format of one letter and then five letters or numbers ie C12345 or F4567U. My problem comes when the first number is zero ie E09876, excel truncates it to E9876. I the #NAME? error by getting is to put everything as ="G45678", however I'm still stuck with the lost '0'.
Is there a way of looking at the length of a formula in a cell, and if it is too short inserting a zero in a relevant position?
TIA
Henry

=IF(LEN(A1)=6,CONCATENATE(MID(A1,1,1),"0",MID(A1,2,6)),A1)

If the data is in cell A1, that is if the length of the string is always 6 without the 0 and 7 with the 0. If it is different the formula will need modifying.




_________________
Regards,

Gary Hewitt-Long
This message was edited by gplhl on 2002-02-28 11:40
 
Upvote 0

Forum statistics

Threads
1,213,532
Messages
6,114,177
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top