Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

suffix 0 forumula

Posted on 2014-10-02
4
90 Views
Last Modified: 2014-10-02
I need a forumula to add a 0 to some text, i.e. in A1 I want the contents of B1 with a 0 in front so if B1 contains 7869, A1 should become 07869. Unfortunately these are not all fixed length so I cant format the fields. Also I some of the entries in column B are blank, in those cases I want A1 to stay blank, and not simply show 0. Any pointers?
0
Comment
Question by:pma111
  • 2
4 Comments
 
LVL 50

Accepted Solution

by:
Rgonzo1971 earned 167 total points
ID: 40356615
Hi,

pls try

=IF(B1<>"","0"&B1,"")

Regards
0
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 333 total points
ID: 40356617
Try this:

=IF(A1="","","0"&TEXT(A1,REPT("0",LEN(A1)))

Thanks
Rob H
0
 
LVL 33

Assisted Solution

by:Rob Henson
Rob Henson earned 333 total points
ID: 40356626
Or:

=IF(A1="","",TEXT(A1,REPT("0",LEN(A1)+1))

Thanks
Rob H
0
 
LVL 14

Expert Comment

by:frankhelk
ID: 40356651
If it's only for numbers to display, you could do that with the formatting.

Open cell formatting dialog, tab numbers, click on "User defined format" and enter 00000 as format definition.

That will add as much zeroes to the beginning onf the numer as needed to reach the given number of digits in the formt definition. 1 will be displayed as 00001, 11 will be displayed as 00011 and so on. If the length of the number equals or exceeds the length of the format string, the the full number will be displayed w/o any zeroes.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question