Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-09-2008, 08:07 AM
James8309
 
Posts: n/a
LEN Problem

Hi everyone

I have different digit of numbers in column B and I am trying to use
"if" and " concatenate" statement together but it creates an error.

=IF(LEN(B3)=5,CONCATENATE("CB0010",B3),IF(LEN(B3)= 4,CONCATENATE("CB00100",B3),IF(LEN(B3)=3,CONCATENA TE("CB001000",B3),"")))

if I just go if(len(b3)=5,concatenate("CB0010",b3),"") then it works
fine but above formula returns 0

can anyone help?


thank you


regards,


James
Reply With Quote
  #2 (permalink)  
Old 07-09-2008, 10:17 AM
Rick Rothstein \(MVP - VB\)
 
Posts: n/a
Re: LEN Problem

It is always a good idea to explain **what** error you are getting rather
than to just say you got an error. I see nothing wrong wrong with your
formula and when I tried it out, it worked fine... I got no errors. By the
way, you do not need to use the CONCATENATE formula for such simple
concatenations, you can just use an ampersand (&) to concatenate the text.
So, your formula can be reduced to this...

=IF(LEN(B3)=5,"CB0010"&B3,IF(LEN(B3)=4,"CB00100"&B 3,IF(LEN(B3)=3,"CB001000"&B3,"")))

Rick


"James8309" <jaedong1221@gmail.com> wrote in message
news:59637079-fa0d-499b-a17e-e9d3518f636e@a70g2000hsh.googlegroups.com...
> Hi everyone
>
> I have different digit of numbers in column B and I am trying to use
> "if" and " concatenate" statement together but it creates an error.
>
> =IF(LEN(B3)=5,CONCATENATE("CB0010",B3),IF(LEN(B3)= 4,CONCATENATE("CB00100",B3),IF(LEN(B3)=3,CONCATENA TE("CB001000",B3),"")))
>
> if I just go if(len(b3)=5,concatenate("CB0010",b3),"") then it works
> fine but above formula returns 0
>
> can anyone help?
>
>
> thank you
>
>
> regards,
>
>
> James


Reply With Quote
  #3 (permalink)  
Old 07-09-2008, 11:30 AM
Ron Rosenfeld
 
Posts: n/a
Re: LEN Problem

On Wed, 9 Jul 2008 00:07:11 -0700 (PDT), James8309 <jaedong1221@gmail.com>
wrote:

>Hi everyone
>
>I have different digit of numbers in column B and I am trying to use
>"if" and " concatenate" statement together but it creates an error.
>
>=IF(LEN(B3)=5,CONCATENATE("CB0010",B3),IF(LEN(B3) =4,CONCATENATE("CB00100",B3),IF(LEN(B3)=3,CONCATEN ATE("CB001000",B3),"")))
>
>if I just go if(len(b3)=5,concatenate("CB0010",b3),"") then it works
>fine but above formula returns 0
>
>can anyone help?
>
>
>thank you
>
>
>regards,
>
>
>James


Your formula works OK for me.

What error do you get?

Is the data in B3 within the range 100-99999?

If the data in B3 will always be a number, the formula below is equivalent:

=IF(OR(B3>99999,B3<100),"",TEXT(B3,"""CB0010""0000 0"))
--ron
Reply With Quote
  #4 (permalink)  
Old 07-09-2008, 01:05 PM
Dave Peterson
 
Posts: n/a
Re: LEN Problem

First, I don't use the =concatenate() function. It takes too long to type and
could eat up a function call in a long expression.

I use the & operator:
=concatenate("cb0010",b3)
is the same as:
="cb0010"&b3

Another posibility for both numbers and text:
=IF(OR(LEN(B3)<3,LEN(B3)>5),"","CB0010"&REPT("0",5 -LEN(B3))&B3)



James8309 wrote:
>
> Hi everyone
>
> I have different digit of numbers in column B and I am trying to use
> "if" and " concatenate" statement together but it creates an error.
>
> =IF(LEN(B3)=5,CONCATENATE("CB0010",B3),IF(LEN(B3)= 4,CONCATENATE("CB00100",B3),IF(LEN(B3)=3,CONCATENA TE("CB001000",B3),"")))
>
> if I just go if(len(b3)=5,concatenate("CB0010",b3),"") then it works
> fine but above formula returns 0
>
> can anyone help?
>
> thank you
>
> regards,
>
> James


--

Dave Peterson
Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > Excel


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 02:40 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Remortgages | Equity Release | Ringtones | Personal Finance | Credit Cards



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114