Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Wrong result from formula - please evaluate

PLEASE EXCUSE MY NOT FOLLOWING PROPER PROTOCOL FOR SHOWING MY EXAMPLE, I AM
IN A HURRY AND IT IS MORE LOGICAL TO ME THIS WAY:

=IF(LEN(D1855)<=17,IF(LEN(B1855<=7),IF(FIND("STE", B1855,1),CONCATENATE(D1855," ",B1855))),"")

Column A contains LEN(B1855) (EXCEL returned value 8)
Column C contains LEN(D1855) (EXCEL returned value 17)
Column B and D are simple data (text)

A B C D E

8 STE 1234 17 123 S CENTRAL AVE 123 S CENTRAL AVE STE 1234

I am tracking field length as I revise a huge database (30k rows of customer
data) and only have 25 CHAR fields to work with when I upload back to our
Company Database program

PROBLEM: I should be getting a FALSE result, because the LEN of Column B IS
NOT <=7, it is 8. Yet, the formula continues to the end. When it Concats, I
end up with 26 characters in Column E.

Thank you! Melinda



  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5,441
Default Wrong result from formula - please evaluate

One problem that is immediately apparent:

IF(LEN(B1855<=7),

should be

IF(LEN(B1855)<=7,

and you should also set the returns for FALSE:

=IF(LEN(D1855)<=17,IF(LEN(B1855)<=7,IF(FIND("STE", B1855,1),CONCATENATE(D1855," ",B1855),"STE not
found in B"),"B 7"),"D 17")

HTH,
Bernie
MS Excel MVP


"waldetta" wrote in message
...
PLEASE EXCUSE MY NOT FOLLOWING PROPER PROTOCOL FOR SHOWING MY EXAMPLE, I AM
IN A HURRY AND IT IS MORE LOGICAL TO ME THIS WAY:

=IF(LEN(D1855)<=17,IF(LEN(B1855<=7),IF(FIND("STE", B1855,1),CONCATENATE(D1855," ",B1855))),"")

Column A contains LEN(B1855) (EXCEL returned value 8)
Column C contains LEN(D1855) (EXCEL returned value 17)
Column B and D are simple data (text)

A B C D E

8 STE 1234 17 123 S CENTRAL AVE 123 S CENTRAL AVE STE 1234

I am tracking field length as I revise a huge database (30k rows of customer
data) and only have 25 CHAR fields to work with when I upload back to our
Company Database program

PROBLEM: I should be getting a FALSE result, because the LEN of Column B IS
NOT <=7, it is 8. Yet, the formula continues to the end. When it Concats, I
end up with 26 characters in Column E.

Thank you! Melinda





  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Wrong result from formula - please evaluate

Bernie, Bernie, Bernie....

I will tell the MS EXCEL world I am an idiot! I have looked at this formula
(and about 25 others, each doing a different part of my SEARCH CLEAN and
DESTROY that I simply missed it.

BUT! After writing this, I realized that the actual goal is to not exceed
25 CHARS, so I modified to take a total of the two fields, using and IF(AND).
Now it is better.

Thank you!

=IF(LEN(I15)<=17,IF(LEN(G15)<=7,IF(FIND("STE",G15, 1),CONCATENATE(I15,"
",G15),"")))

Thank you!

"Bernie Deitrick" wrote:

One problem that is immediately apparent:

IF(LEN(B1855<=7),

should be

IF(LEN(B1855)<=7,

and you should also set the returns for FALSE:

=IF(LEN(D1855)<=17,IF(LEN(B1855)<=7,IF(FIND("STE", B1855,1),CONCATENATE(D1855," ",B1855),"STE not
found in B"),"B 7"),"D 17")

HTH,
Bernie
MS Excel MVP


"waldetta" wrote in message
...
PLEASE EXCUSE MY NOT FOLLOWING PROPER PROTOCOL FOR SHOWING MY EXAMPLE, I AM
IN A HURRY AND IT IS MORE LOGICAL TO ME THIS WAY:

=IF(LEN(D1855)<=17,IF(LEN(B1855<=7),IF(FIND("STE", B1855,1),CONCATENATE(D1855," ",B1855))),"")

Column A contains LEN(B1855) (EXCEL returned value 8)
Column C contains LEN(D1855) (EXCEL returned value 17)
Column B and D are simple data (text)

A B C D E

8 STE 1234 17 123 S CENTRAL AVE 123 S CENTRAL AVE STE 1234

I am tracking field length as I revise a huge database (30k rows of customer
data) and only have 25 CHAR fields to work with when I upload back to our
Company Database program

PROBLEM: I should be getting a FALSE result, because the LEN of Column B IS
NOT <=7, it is 8. Yet, the formula continues to the end. When it Concats, I
end up with 26 characters in Column E.

Thank you! Melinda






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 622
Default Wrong result from formula - please evaluate

On Aug 25, 11:42 am, waldetta
wrote:
PLEASE EXCUSE MY NOT FOLLOWING PROPER PROTOCOL FOR SHOWING MY EXAMPLE, I AM
IN A HURRY AND IT IS MORE LOGICAL TO ME THIS WAY:

=IF(LEN(D1855)<=17,IF(LEN(B1855<=7),IF(FIND("STE", B1855,1),CONCATENATE(D1855," ",B1855))),"")

Column A contains LEN(B1855) (EXCEL returned value 8)
Column C contains LEN(D1855) (EXCEL returned value 17)
Column B and D are simple data (text)

A B C D E

8 STE 1234 17 123 S CENTRAL AVE 123 S CENTRAL AVE STE 1234

I am tracking field length as I revise a huge database (30k rows of customer
data) and only have 25 CHAR fields to work with when I upload back to our
Company Database program

PROBLEM: I should be getting a FALSE result, because the LEN of Column B IS
NOT <=7, it is 8. Yet, the formula continues to the end. When it Concats, I
end up with 26 characters in Column E.

Thank you! Melinda


You have a parenthesis in the wrong place in the 2nd LEN:
=IF(LEN(D1855)<=17,IF(LEN(B1855)<=7,IF(FIND("STE", B1855,1),CONCATENATE(D1855,"
",B1855))),"")
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Wrong result from formula - please evaluate

Thak you Spiky.. I am bleary-eyed from writing these ridiculous formulas, and
I just didn't see it. You can see that I did not forget it in the first IF,
I just missed it the second time.

:)

"Spiky" wrote:

On Aug 25, 11:42 am, waldetta
wrote:
PLEASE EXCUSE MY NOT FOLLOWING PROPER PROTOCOL FOR SHOWING MY EXAMPLE, I AM
IN A HURRY AND IT IS MORE LOGICAL TO ME THIS WAY:

=IF(LEN(D1855)<=17,IF(LEN(B1855<=7),IF(FIND("STE", B1855,1),CONCATENATE(D1855," ",B1855))),"")

Column A contains LEN(B1855) (EXCEL returned value 8)
Column C contains LEN(D1855) (EXCEL returned value 17)
Column B and D are simple data (text)

A B C D E

8 STE 1234 17 123 S CENTRAL AVE 123 S CENTRAL AVE STE 1234

I am tracking field length as I revise a huge database (30k rows of customer
data) and only have 25 CHAR fields to work with when I upload back to our
Company Database program

PROBLEM: I should be getting a FALSE result, because the LEN of Column B IS
NOT <=7, it is 8. Yet, the formula continues to the end. When it Concats, I
end up with 26 characters in Column E.

Thank you! Melinda


You have a parenthesis in the wrong place in the 2nd LEN:
=IF(LEN(D1855)<=17,IF(LEN(B1855)<=7,IF(FIND("STE", B1855,1),CONCATENATE(D1855,"
",B1855))),"")



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,358
Default Wrong result from formula - please evaluate

You could also try the following formula. This has some error checking as well:

=IF(AND(LEN(D1855)<=17,LEN(B1855<=7),ISERROR(FIND( "STE",B1855,1))=0),D1855&"
"&B1855,"")
--
John C


"waldetta" wrote:

PLEASE EXCUSE MY NOT FOLLOWING PROPER PROTOCOL FOR SHOWING MY EXAMPLE, I AM
IN A HURRY AND IT IS MORE LOGICAL TO ME THIS WAY:

=IF(LEN(D1855)<=17,IF(LEN(B1855<=7),IF(FIND("STE", B1855,1),CONCATENATE(D1855," ",B1855))),"")

Column A contains LEN(B1855) (EXCEL returned value 8)
Column C contains LEN(D1855) (EXCEL returned value 17)
Column B and D are simple data (text)

A B C D E

8 STE 1234 17 123 S CENTRAL AVE 123 S CENTRAL AVE STE 1234

I am tracking field length as I revise a huge database (30k rows of customer
data) and only have 25 CHAR fields to work with when I upload back to our
Company Database program

PROBLEM: I should be getting a FALSE result, because the LEN of Column B IS
NOT <=7, it is 8. Yet, the formula continues to the end. When it Concats, I
end up with 26 characters in Column E.

Thank you! Melinda



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula giving wrong result Jock Excel Worksheet Functions 5 October 15th 07 04:18 PM
Formula returning wrong result. Steve Hunt Excel Worksheet Functions 1 December 2nd 06 09:10 AM
FORMULA PRODUCES WRONG RESULT Wildebeest222 Excel Discussion (Misc queries) 2 October 11th 05 09:27 AM
UDF to evaluate result of concatenate() with additional arg. [email protected] Excel Discussion (Misc queries) 2 January 13th 05 01:47 PM
Formula Result Correct but value in the cell is wrong jac Excel Worksheet Functions 2 December 17th 04 08:05 PM


All times are GMT +1. The time now is 04:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"