Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Matching 2 columns

I have 6 columns of data. 2 of the columns are called ID and there are
thousuands of id numbers in both columns, but currently do not match up. I
want both id columns to have the same id in a row. So for example row 2
should have id#6 in column A and its information related to it in B & C as
well as Column D having id#6 and the 2 columns associatd with that id (as
well as the other information that those ids were associated with).
How do I go about doing this?

Thanks,
~JJ44
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default Matching 2 columns

If sorting rows A-C and then doing the same for rows D-F (sorted by id#)
doesn't do it, then you might consider some helper columns.

Helper Columns H, I, & J.

Assuming your data starts at A2.
In H2, enter:
=A2
In I2, Enter:
=INDIRECT("E"&MATCH($H14,D:D,0))
In J2, Enter:
=INDIRECT("F"&MATCH($H14,D:D,0))

Fill down these three formulas as far as needed.
Then you can copy the data in those three columns and paste special-Values
beginning at D2.

HTH,
Paul

"JJ44" wrote in message
...
I have 6 columns of data. 2 of the columns are called ID and there are
thousuands of id numbers in both columns, but currently do not match up. I
want both id columns to have the same id in a row. So for example row 2
should have id#6 in column A and its information related to it in B & C as
well as Column D having id#6 and the 2 columns associatd with that id (as
well as the other information that those ids were associated with).
How do I go about doing this?

Thanks,
~JJ44



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Matching 2 columns

Sorting will not work as there will not be a match for every item...I am not
really sure what the helper columns are trying to do for me or how that will
even help. I also am not exactly sure how to use them. What does the indirect
function even do and the cells you are referring to in the formula? Here is
an example of what I have to work with:
And I would want to get id 1 with a cost of 20 and quantity 1 (first 3
columns) in the same row as id 1, cost of 18 and quantity of 1 (last 3
columns).

ID Cost Quantity ID Cost Quantity
1 20 1 5 75 2
2 30 1 8 100 3
6 35 1 3 122 3
4 50 2 7 30 3
5 67 2 2 30 1
8 85 3 4 65 2
7 45 3 1 18 1
3 33 3 6 50 1
10 55 5
20 100 5

Hope this is explained better.
John

"PCLIVE" wrote:

If sorting rows A-C and then doing the same for rows D-F (sorted by id#)
doesn't do it, then you might consider some helper columns.

Helper Columns H, I, & J.

Assuming your data starts at A2.
In H2, enter:
=A2
In I2, Enter:
=INDIRECT("E"&MATCH($H14,D:D,0))
In J2, Enter:
=INDIRECT("F"&MATCH($H14,D:D,0))

Fill down these three formulas as far as needed.
Then you can copy the data in those three columns and paste special-Values
beginning at D2.

HTH,
Paul

"JJ44" wrote in message
...
I have 6 columns of data. 2 of the columns are called ID and there are
thousuands of id numbers in both columns, but currently do not match up. I
want both id columns to have the same id in a row. So for example row 2
should have id#6 in column A and its information related to it in B & C as
well as Column D having id#6 and the 2 columns associatd with that id (as
well as the other information that those ids were associated with).
How do I go about doing this?

Thanks,
~JJ44




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,311
Default Matching 2 columns

Ok,

The helper columns are basically temporary columns that you setup in order
to come to the results needed. Find 3 available consecutive columns off to
the right of your data. I've used columns H, I, and J in my example. In my
previous example, my formula would have produced #N/A if the id in column A
was not found in column D. So I've taken care of that in these formulas.
Again, this assumes that you have a header row and your data begins at A2.

In cell H2, enter this formula:
=A2
In cell I2, enter this formula:
=IF(ISERROR(MATCH($H2,D:D,0)),"",INDIRECT("E"&MATC H($H2,D:D,0)))
In cell J2, enter this formula:
=IF(ISERROR(MATCH($H2,D:D,0)),"",INDIRECT("F"&MATC H($H2,D:D,0)))


Copy these formulas down as many rows down as your data in column A.
The MATCH function returns the row number of a value found in a designated
range. So the formula looks for the data from H2 (technically A2) from
within the range of column D. Since it only returns the row number, then we
use INDIRECT to return a value in a specified cell beginning with the column
letter and then the row number that was determined using the MATCH function.

HTH,
Paul



"JJ44" wrote in message
...
Sorting will not work as there will not be a match for every item...I am
not
really sure what the helper columns are trying to do for me or how that
will
even help. I also am not exactly sure how to use them. What does the
indirect
function even do and the cells you are referring to in the formula? Here
is
an example of what I have to work with:
And I would want to get id 1 with a cost of 20 and quantity 1 (first 3
columns) in the same row as id 1, cost of 18 and quantity of 1 (last 3
columns).

ID Cost Quantity ID Cost Quantity
1 20 1 5 75 2
2 30 1 8 100 3
6 35 1 3 122 3
4 50 2 7 30 3
5 67 2 2 30 1
8 85 3 4 65 2
7 45 3 1 18 1
3 33 3 6 50 1
10 55 5
20 100 5

Hope this is explained better.
John

"PCLIVE" wrote:

If sorting rows A-C and then doing the same for rows D-F (sorted by id#)
doesn't do it, then you might consider some helper columns.

Helper Columns H, I, & J.

Assuming your data starts at A2.
In H2, enter:
=A2
In I2, Enter:
=INDIRECT("E"&MATCH($H14,D:D,0))
In J2, Enter:
=INDIRECT("F"&MATCH($H14,D:D,0))

Fill down these three formulas as far as needed.
Then you can copy the data in those three columns and paste
special-Values
beginning at D2.

HTH,
Paul

"JJ44" wrote in message
...
I have 6 columns of data. 2 of the columns are called ID and there are
thousuands of id numbers in both columns, but currently do not match
up. I
want both id columns to have the same id in a row. So for example row
2
should have id#6 in column A and its information related to it in B & C
as
well as Column D having id#6 and the 2 columns associatd with that id
(as
well as the other information that those ids were associated with).
How do I go about doing this?

Thanks,
~JJ44






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 on columns nick Excel Discussion (Misc queries) 0 October 24th 06 05:02 PM
Matching Multiple Columns [email protected] Excel Worksheet Functions 4 October 1st 06 06:18 AM
MATCHING COLUMNS JOE Excel Discussion (Misc queries) 0 May 3rd 06 05:51 PM
Matching data from 2 columns doohen Excel Worksheet Functions 12 December 22nd 05 07:05 PM
Matching and aligning columns amerkarim Excel Worksheet Functions 2 September 24th 05 02:15 PM


All times are GMT +1. The time now is 12:23 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"