Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Comparing characters in one cell to multiple cells

I'm trying to create a method that will return a value from the
differences between cells.

Example data
A B C D E F G H
Row 1: BBB BBS BSB BSS SBB SSS BBB Result
Row 2: BSB BSB BBS SSS Result

The left column is the reference and the others are compared against
this. There are at most six columns to compare against (B through
G). The cells in any column may be blank, I'd like to ignore these.
The worksheet will have over 5000 lines with data.


For row 1: Row 2
A to B: 1 difference 0
A to C: 1 2
A to D: 2 3
A to E: 1
A to F: 3
A to G: 0

So I'd like the result to be 8 for row 1 and 5 for row 2 with one
result per row.

I've thought of something like this:
=SUM(IF(MID(a1,1,1)<MID(b1,1,1),
1,0)*1,IF(MID(a1,2,1)<MID(b1,2,1),1,0)*1,IF(MID(a 1,3,1)<MID(b1,3,1),
1,0)*1)
but the resulting function for six columns would be huge. I hope
there's something more managable that can be done.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Comparing characters in one cell to multiple cells

=3-((MID($A$1,1,1)=MID(B1,1,1))+(MID($A$1,2,1)=MID(B1 ,2,1))+(MID($A$1,3,1)=MID(B1,3,1)))

copy across


"Quirthanon" wrote:

I'm trying to create a method that will return a value from the
differences between cells.

Example data
A B C D E F G H
Row 1: BBB BBS BSB BSS SBB SSS BBB Result
Row 2: BSB BSB BBS SSS Result

The left column is the reference and the others are compared against
this. There are at most six columns to compare against (B through
G). The cells in any column may be blank, I'd like to ignore these.
The worksheet will have over 5000 lines with data.


For row 1: Row 2
A to B: 1 difference 0
A to C: 1 2
A to D: 2 3
A to E: 1
A to F: 3
A to G: 0

So I'd like the result to be 8 for row 1 and 5 for row 2 with one
result per row.

I've thought of something like this:
=SUM(IF(MID(a1,1,1)<MID(b1,1,1),
1,0)*1,IF(MID(a1,2,1)<MID(b1,2,1),1,0)*1,IF(MID(a 1,3,1)<MID(b1,3,1),
1,0)*1)
but the resulting function for six columns would be huge. I hope
there's something more managable that can be done.


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
Creating a series of cells with multiple incrimenting characters markb Excel Worksheet Functions 2 June 30th 07 04:50 AM
How to count occurence of multiple characters in a cell MLK Excel Worksheet Functions 4 March 9th 07 12:51 AM
Comparing multiple cells scoobydoo2006 Excel Discussion (Misc queries) 3 June 15th 06 10:57 PM
Comparing multiple cell values scoobydoo2006 Excel Discussion (Misc queries) 0 June 13th 06 04:58 PM
Problems comparing data from multiple blank cells monkeyhop Excel Worksheet Functions 4 May 2nd 06 05:48 AM


All times are GMT +1. The time now is 08:34 AM.

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

About Us

"It's about Microsoft Excel"