Solved

suffix 0 forumula

Posted on 2014-10-02
4
93 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
[X]
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
  • 2
4 Comments
 
LVL 51

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
This article describes a serious pitfall that can happen when deleting shapes using VBA.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

688 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