Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
how do i create a condition on a particular cell if it's characters are less
than 8 it will add a character? e.g. if i put "abcdefg" in my cell, there are only 7 characters in it. the other cell will automatically add a new 1 before the original character so it will become "zabcdefg" which "z" is the character added to make it 8 -- Message posted via http://www.officekb.com |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
And if it were only 1 character, you'd end up with:
zzzzzzza And if it were empty, leave it empty? =if(a1="","",right(rept("z",8)&a1,8)) This will actually truncate the string at 8 characters. If the original had 1000 characters, the formula will result in the 8 rightmost. "enrico via OfficeKB.com" wrote: how do i create a condition on a particular cell if it's characters are less than 8 it will add a character? e.g. if i put "abcdefg" in my cell, there are only 7 characters in it. the other cell will automatically add a new 1 before the original character so it will become "zabcdefg" which "z" is the character added to make it 8 -- Message posted via http://www.officekb.com -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
what if there are a lot of characters? i don't want to truncate the other
values. all i want is if my variable inside the cell is less than 8 characters then it will add another one to make it 8 -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200910/1 |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Just add another check:
=IF(A1="","",IF(LEN(A1)8,A1,RIGHT(REPT("z",8)&A1, 8))) "enrico via OfficeKB.com" wrote: what if there are a lot of characters? i don't want to truncate the other values. all i want is if my variable inside the cell is less than 8 characters then it will add another one to make it 8 -- Message posted via OfficeKB.com http://www.officekb.com/Uwe/Forums.a...excel/200910/1 -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Mon, 26 Oct 2009 00:29:09 GMT, "enrico via OfficeKB.com" <u41845@uwe wrote:
how do i create a condition on a particular cell if it's characters are less than 8 it will add a character? e.g. if i put "abcdefg" in my cell, there are only 7 characters in it. the other cell will automatically add a new 1 before the original character so it will become "zabcdefg" which "z" is the character added to make it 8 Maybe: =REPT("z",MAX(0,8-LEN(A1)))&A1 --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel insists on adding character to formula | Excel Worksheet Functions | |||
adding up a particular character in a row | Excel Discussion (Misc queries) | |||
Adding a character to a defined name with a formula or macro | Excel Discussion (Misc queries) | |||
Adding overscore to character in a cell in an Excell spreadsheet | Excel Discussion (Misc queries) | |||
Adding a character to the beginning and end of txt in a cell | Excel Worksheet Functions |