Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default VBA: Matching cells across columns, and returning equal values

I don't really know exactly which functions I'm asking about here, but I know
what I want to accomplish - I have a suspicion that the solution is just to
use some smart planning, rather than highly complicated programming...

I currently have a number of Strings in Column A, and a number of Integers
in Columns B, C, D, etc... Each String has a matching Integer in all the
other columns, but I don't know yet how many other columns I'll have. The
Integers range from 1-20.

What I want to do is to manually select a string1 and a string2, and look at
what the values in the respective cells following them are. So if String1 is
"Dog" I want my function to look through Column A, find the string: "Dog"
(which will definitely only occur once in that column) and figure out what
the values for Column B, C, and D are on the "Dog" Row, essentially ending up
with something like "Dog:2:3:8," if the values in columns B, C, and D are 2,
3, and 8. Then I want to do the same with String2, and once I have done that
I want to compare the results and find out how many matches there are.

So, if I have selected my strings and checked their column values, and ended
up with some kind of result that's similar to "Dog:2:3:8" and "Cat:9:3:2" I
want to compare these results against each other and the function should tell
me that I have one match - that for both String1 and String2, one value is
the same (Value 3 in column C). If the results are "Dog:1:1:5:7" and
"Cat:2:1:5:1" I want the function to tell me that there are two matches (1
and 5 in columns C and D).

Hopefully this description wasn't too confusing - I have a basic outline of
how I should do this, but I can't think of a good way to approach the
implementation, so I'm hoping you can help. One basic idea I have is to input
String1 and String2, and then If String1's value for Column B = String2's
value for column B, variableX +1 for columns b - f, and then return value x,
but I don't know if that's the best solution, and I don't know exactly how I
should write the matching routine.

Thanks!
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
Matching Three columns and returning a value Rob Excel Discussion (Misc queries) 5 April 29th 08 09:04 AM
Matching & Returning values DebbieV Excel Discussion (Misc queries) 3 March 6th 08 11:00 AM
Matching numbers in an Array and returning values for matched numb Tiger Excel Discussion (Misc queries) 8 April 26th 07 06:14 AM
returning all matching values in column A that have the same value for columnB [email protected] Excel Worksheet Functions 3 August 30th 06 06:51 PM
Returning a Value by Matching Two Columns of Data Christine Edwards Excel Worksheet Functions 5 May 10th 06 07:28 PM


All times are GMT +1. The time now is 10:19 PM.

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"