I am looking to pad a columns with zero's so that I can later concatenate it's value. It needs to 4 characters, so I am trying to use a Nested If Statement.
=IF(LEN(G2)=3,"0" & G2),IF(LEN(G2)=2,"00" & G2,G2)
I only get '#Value'. Where am I going wrong?
Don't reinvent the wheel: there is already a built-in function do to this.
=TEXT(G2,"0000")
Now, to answer your question specifically, the reason you got your error was that your IF
functions weren't properly nested due to misplaced right brackets )
.
Was:
=IF(LEN(G2)=3,"0" & G2),IF(LEN(G2)=2,"00" & G2,G2)
^
Should be:
=IF(LEN(G2)=3,"0" & G2,IF(LEN(G2)=2,"00" & G2,G2))
^
Still, this won't give you the expected results. Just go with the built-in TEXT
function.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다