Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default find multiple data cells for one data source

I need a formula that will help me organize country codes. In Column A, I
have 3 digit codes that have a country code, in column B, associated with it.
The 3 digit codes appear multiple times in the spreadsheet. I need a way to
show the 3 digit code and any and all of the country codes that are
associated with it on one row.

Example of my raw data below:
ABF CN
ABF MX
ABF US
ACC CN
ACC IE
ACC MX
ACC TW
ACC US

Desired Output:
Col A Col B Col C Col D Col E Col F
ABF CN MX US
ACC CN IE MX TW US


Satisfactory output:
ABF CN, MX, US
ACC CN, IE, MX, TW, US


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default find multiple data cells for one data source

With data in Sheet1 ColA/ColB

With ABF in Sheet2 cell A1 ; try the below formula in Sheet2 cell B1 and
copy across as required..

Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=<formula}"

=IF(COUNTIF(Sheet1!$A$1:$A$1000,$A1)<COLUMN(A1),"" ,
INDEX(Sheet1!$B1:$B1000,SMALL(IF(Sheet1!$A$1:$A$10 00=$A1,
ROW($A$1:$A$1000)),COLUMN(A1))))

--
Jacob


"brantty" wrote:

I need a formula that will help me organize country codes. In Column A, I
have 3 digit codes that have a country code, in column B, associated with it.
The 3 digit codes appear multiple times in the spreadsheet. I need a way to
show the 3 digit code and any and all of the country codes that are
associated with it on one row.

Example of my raw data below:
ABF CN
ABF MX
ABF US
ACC CN
ACC IE
ACC MX
ACC TW
ACC US

Desired Output:
Col A Col B Col C Col D Col E Col F
ABF CN MX US
ACC CN IE MX TW US


Satisfactory output:
ABF CN, MX, US
ACC CN, IE, MX, TW, US


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default find multiple data cells for one data source

Jacob,

Im new to array formulas. I copied the formula, and it finds the first
code, but that is all. When I copied it across to columns, c,d,e, etc, I
just get a #NUM!. Can you dumb this down for me?

Ty

"Jacob Skaria" wrote:

With data in Sheet1 ColA/ColB

With ABF in Sheet2 cell A1 ; try the below formula in Sheet2 cell B1 and
copy across as required..

Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=<formula}"

=IF(COUNTIF(Sheet1!$A$1:$A$1000,$A1)<COLUMN(A1),"" ,
INDEX(Sheet1!$B1:$B1000,SMALL(IF(Sheet1!$A$1:$A$10 00=$A1,
ROW($A$1:$A$1000)),COLUMN(A1))))

--
Jacob


"brantty" wrote:

I need a formula that will help me organize country codes. In Column A, I
have 3 digit codes that have a country code, in column B, associated with it.
The 3 digit codes appear multiple times in the spreadsheet. I need a way to
show the 3 digit code and any and all of the country codes that are
associated with it on one row.

Example of my raw data below:
ABF CN
ABF MX
ABF US
ACC CN
ACC IE
ACC MX
ACC TW
ACC US

Desired Output:
Col A Col B Col C Col D Col E Col F
ABF CN MX US
ACC CN IE MX TW US


Satisfactory output:
ABF CN, MX, US
ACC CN, IE, MX, TW, US


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default find multiple data cells for one data source

Just try again. Do you see the curly braces around the formula. Press
CTRL+SHIFT+ENTER instead of just ENTER .

--
Jacob


"brantty" wrote:

Jacob,

Im new to array formulas. I copied the formula, and it finds the first
code, but that is all. When I copied it across to columns, c,d,e, etc, I
just get a #NUM!. Can you dumb this down for me?

Ty

"Jacob Skaria" wrote:

With data in Sheet1 ColA/ColB

With ABF in Sheet2 cell A1 ; try the below formula in Sheet2 cell B1 and
copy across as required..

Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=<formula}"

=IF(COUNTIF(Sheet1!$A$1:$A$1000,$A1)<COLUMN(A1),"" ,
INDEX(Sheet1!$B1:$B1000,SMALL(IF(Sheet1!$A$1:$A$10 00=$A1,
ROW($A$1:$A$1000)),COLUMN(A1))))

--
Jacob


"brantty" wrote:

I need a formula that will help me organize country codes. In Column A, I
have 3 digit codes that have a country code, in column B, associated with it.
The 3 digit codes appear multiple times in the spreadsheet. I need a way to
show the 3 digit code and any and all of the country codes that are
associated with it on one row.

Example of my raw data below:
ABF CN
ABF MX
ABF US
ACC CN
ACC IE
ACC MX
ACC TW
ACC US

Desired Output:
Col A Col B Col C Col D Col E Col F
ABF CN MX US
ACC CN IE MX TW US


Satisfactory output:
ABF CN, MX, US
ACC CN, IE, MX, TW, US


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default find multiple data cells for one data source

Jacob,

I see the curly braces now. But the formula doesnt seem to find all the
data on the second item. In the example below. my results show:

ABF CN MX US
ACC MX MX TW US 0

Its missing the first two codes. But could it have something to do with the
fact that my Sheet 2, col A, has the 3 digit code showing once,(no
duplicates) and the Sheet 1 has many duplicates. So, Sheet 1 Column A will
not match Sheet 2 column A.

Ty

"Jacob Skaria" wrote:

Just try again. Do you see the curly braces around the formula. Press
CTRL+SHIFT+ENTER instead of just ENTER .

--
Jacob


"brantty" wrote:

Jacob,

Im new to array formulas. I copied the formula, and it finds the first
code, but that is all. When I copied it across to columns, c,d,e, etc, I
just get a #NUM!. Can you dumb this down for me?

Ty

"Jacob Skaria" wrote:

With data in Sheet1 ColA/ColB

With ABF in Sheet2 cell A1 ; try the below formula in Sheet2 cell B1 and
copy across as required..

Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=<formula}"

=IF(COUNTIF(Sheet1!$A$1:$A$1000,$A1)<COLUMN(A1),"" ,
INDEX(Sheet1!$B1:$B1000,SMALL(IF(Sheet1!$A$1:$A$10 00=$A1,
ROW($A$1:$A$1000)),COLUMN(A1))))

--
Jacob


"brantty" wrote:

I need a formula that will help me organize country codes. In Column A, I
have 3 digit codes that have a country code, in column B, associated with it.
The 3 digit codes appear multiple times in the spreadsheet. I need a way to
show the 3 digit code and any and all of the country codes that are
associated with it on one row.

Example of my raw data below:
ABF CN
ABF MX
ABF US
ACC CN
ACC IE
ACC MX
ACC TW
ACC US

Desired Output:
Col A Col B Col C Col D Col E Col F
ABF CN MX US
ACC CN IE MX TW US


Satisfactory output:
ABF CN, MX, US
ACC CN, IE, MX, TW, US




  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default find multiple data cells for one data source

I missed a $ (absolute reference)..Try with the below in cell B1 and copy
down/across as required

=IF(COUNTIF(Sheet1!$A$1:$A$1000,$A1)<COLUMN(A1),"" ,
INDEX(Sheet1!$B$1:$B$1000,SMALL(IF(Sheet1!$A$1:$A$ 1000=$A1,
ROW($A$1:$A$1000)),COLUMN(A1))))

--
Jacob


"brantty" wrote:

Jacob,

I see the curly braces now. But the formula doesnt seem to find all the
data on the second item. In the example below. my results show:

ABF CN MX US
ACC MX MX TW US 0

Its missing the first two codes. But could it have something to do with the
fact that my Sheet 2, col A, has the 3 digit code showing once,(no
duplicates) and the Sheet 1 has many duplicates. So, Sheet 1 Column A will
not match Sheet 2 column A.

Ty

"Jacob Skaria" wrote:

Just try again. Do you see the curly braces around the formula. Press
CTRL+SHIFT+ENTER instead of just ENTER .

--
Jacob


"brantty" wrote:

Jacob,

Im new to array formulas. I copied the formula, and it finds the first
code, but that is all. When I copied it across to columns, c,d,e, etc, I
just get a #NUM!. Can you dumb this down for me?

Ty

"Jacob Skaria" wrote:

With data in Sheet1 ColA/ColB

With ABF in Sheet2 cell A1 ; try the below formula in Sheet2 cell B1 and
copy across as required..

Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=<formula}"

=IF(COUNTIF(Sheet1!$A$1:$A$1000,$A1)<COLUMN(A1),"" ,
INDEX(Sheet1!$B1:$B1000,SMALL(IF(Sheet1!$A$1:$A$10 00=$A1,
ROW($A$1:$A$1000)),COLUMN(A1))))

--
Jacob


"brantty" wrote:

I need a formula that will help me organize country codes. In Column A, I
have 3 digit codes that have a country code, in column B, associated with it.
The 3 digit codes appear multiple times in the spreadsheet. I need a way to
show the 3 digit code and any and all of the country codes that are
associated with it on one row.

Example of my raw data below:
ABF CN
ABF MX
ABF US
ACC CN
ACC IE
ACC MX
ACC TW
ACC US

Desired Output:
Col A Col B Col C Col D Col E Col F
ABF CN MX US
ACC CN IE MX TW US


Satisfactory output:
ABF CN, MX, US
ACC CN, IE, MX, TW, US


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default find multiple data cells for one data source

Jacob, Its close, man. The first item (ABF) comes out clean, but when it
looks for the second item (ACC), it doesnt find the first code (CN) and
duplicates the find of MX. Got any other ideas....?

Ty

"Jacob Skaria" wrote:

I missed a $ (absolute reference)..Try with the below in cell B1 and copy
down/across as required

=IF(COUNTIF(Sheet1!$A$1:$A$1000,$A1)<COLUMN(A1),"" ,
INDEX(Sheet1!$B$1:$B$1000,SMALL(IF(Sheet1!$A$1:$A$ 1000=$A1,
ROW($A$1:$A$1000)),COLUMN(A1))))

--
Jacob


"brantty" wrote:

Jacob,

I see the curly braces now. But the formula doesnt seem to find all the
data on the second item. In the example below. my results show:

ABF CN MX US
ACC MX MX TW US 0

Its missing the first two codes. But could it have something to do with the
fact that my Sheet 2, col A, has the 3 digit code showing once,(no
duplicates) and the Sheet 1 has many duplicates. So, Sheet 1 Column A will
not match Sheet 2 column A.

Ty

"Jacob Skaria" wrote:

Just try again. Do you see the curly braces around the formula. Press
CTRL+SHIFT+ENTER instead of just ENTER .

--
Jacob


"brantty" wrote:

Jacob,

Im new to array formulas. I copied the formula, and it finds the first
code, but that is all. When I copied it across to columns, c,d,e, etc, I
just get a #NUM!. Can you dumb this down for me?

Ty

"Jacob Skaria" wrote:

With data in Sheet1 ColA/ColB

With ABF in Sheet2 cell A1 ; try the below formula in Sheet2 cell B1 and
copy across as required..

Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=<formula}"

=IF(COUNTIF(Sheet1!$A$1:$A$1000,$A1)<COLUMN(A1),"" ,
INDEX(Sheet1!$B1:$B1000,SMALL(IF(Sheet1!$A$1:$A$10 00=$A1,
ROW($A$1:$A$1000)),COLUMN(A1))))

--
Jacob


"brantty" wrote:

I need a formula that will help me organize country codes. In Column A, I
have 3 digit codes that have a country code, in column B, associated with it.
The 3 digit codes appear multiple times in the spreadsheet. I need a way to
show the 3 digit code and any and all of the country codes that are
associated with it on one row.

Example of my raw data below:
ABF CN
ABF MX
ABF US
ACC CN
ACC IE
ACC MX
ACC TW
ACC US

Desired Output:
Col A Col B Col C Col D Col E Col F
ABF CN MX US
ACC CN IE MX TW US


Satisfactory output:
ABF CN, MX, US
ACC CN, IE, MX, TW, US


  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default find multiple data cells for one data source

I just tried with your sample data and is working fine. Re-try with the last
formula (array formula in cell B1) and copy down/across...

--
Jacob


"brantty" wrote:

Jacob, Its close, man. The first item (ABF) comes out clean, but when it
looks for the second item (ACC), it doesnt find the first code (CN) and
duplicates the find of MX. Got any other ideas....?

Ty

"Jacob Skaria" wrote:

I missed a $ (absolute reference)..Try with the below in cell B1 and copy
down/across as required

=IF(COUNTIF(Sheet1!$A$1:$A$1000,$A1)<COLUMN(A1),"" ,
INDEX(Sheet1!$B$1:$B$1000,SMALL(IF(Sheet1!$A$1:$A$ 1000=$A1,
ROW($A$1:$A$1000)),COLUMN(A1))))

--
Jacob


"brantty" wrote:

Jacob,

I see the curly braces now. But the formula doesnt seem to find all the
data on the second item. In the example below. my results show:

ABF CN MX US
ACC MX MX TW US 0

Its missing the first two codes. But could it have something to do with the
fact that my Sheet 2, col A, has the 3 digit code showing once,(no
duplicates) and the Sheet 1 has many duplicates. So, Sheet 1 Column A will
not match Sheet 2 column A.

Ty

"Jacob Skaria" wrote:

Just try again. Do you see the curly braces around the formula. Press
CTRL+SHIFT+ENTER instead of just ENTER .

--
Jacob


"brantty" wrote:

Jacob,

Im new to array formulas. I copied the formula, and it finds the first
code, but that is all. When I copied it across to columns, c,d,e, etc, I
just get a #NUM!. Can you dumb this down for me?

Ty

"Jacob Skaria" wrote:

With data in Sheet1 ColA/ColB

With ABF in Sheet2 cell A1 ; try the below formula in Sheet2 cell B1 and
copy across as required..

Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=<formula}"

=IF(COUNTIF(Sheet1!$A$1:$A$1000,$A1)<COLUMN(A1),"" ,
INDEX(Sheet1!$B1:$B1000,SMALL(IF(Sheet1!$A$1:$A$10 00=$A1,
ROW($A$1:$A$1000)),COLUMN(A1))))

--
Jacob


"brantty" wrote:

I need a formula that will help me organize country codes. In Column A, I
have 3 digit codes that have a country code, in column B, associated with it.
The 3 digit codes appear multiple times in the spreadsheet. I need a way to
show the 3 digit code and any and all of the country codes that are
associated with it on one row.

Example of my raw data below:
ABF CN
ABF MX
ABF US
ACC CN
ACC IE
ACC MX
ACC TW
ACC US

Desired Output:
Col A Col B Col C Col D Col E Col F
ABF CN MX US
ACC CN IE MX TW US


Satisfactory output:
ABF CN, MX, US
ACC CN, IE, MX, TW, US


  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 16
Default find multiple data cells for one data source

Jacob, It worked. I had to play with it a little more. Thanks

"Jacob Skaria" wrote:

I missed a $ (absolute reference)..Try with the below in cell B1 and copy
down/across as required

=IF(COUNTIF(Sheet1!$A$1:$A$1000,$A1)<COLUMN(A1),"" ,
INDEX(Sheet1!$B$1:$B$1000,SMALL(IF(Sheet1!$A$1:$A$ 1000=$A1,
ROW($A$1:$A$1000)),COLUMN(A1))))

--
Jacob


"brantty" wrote:

Jacob,

I see the curly braces now. But the formula doesnt seem to find all the
data on the second item. In the example below. my results show:

ABF CN MX US
ACC MX MX TW US 0

Its missing the first two codes. But could it have something to do with the
fact that my Sheet 2, col A, has the 3 digit code showing once,(no
duplicates) and the Sheet 1 has many duplicates. So, Sheet 1 Column A will
not match Sheet 2 column A.

Ty

"Jacob Skaria" wrote:

Just try again. Do you see the curly braces around the formula. Press
CTRL+SHIFT+ENTER instead of just ENTER .

--
Jacob


"brantty" wrote:

Jacob,

Im new to array formulas. I copied the formula, and it finds the first
code, but that is all. When I copied it across to columns, c,d,e, etc, I
just get a #NUM!. Can you dumb this down for me?

Ty

"Jacob Skaria" wrote:

With data in Sheet1 ColA/ColB

With ABF in Sheet2 cell A1 ; try the below formula in Sheet2 cell B1 and
copy across as required..

Please note that this is an array formula. You create array formulas in the
same way that you create other formulas, except you press CTRL+SHIFT+ENTER to
enter the formula. If successful in 'Formula Bar' you can notice the curly
braces at both ends like "{=<formula}"

=IF(COUNTIF(Sheet1!$A$1:$A$1000,$A1)<COLUMN(A1),"" ,
INDEX(Sheet1!$B1:$B1000,SMALL(IF(Sheet1!$A$1:$A$10 00=$A1,
ROW($A$1:$A$1000)),COLUMN(A1))))

--
Jacob


"brantty" wrote:

I need a formula that will help me organize country codes. In Column A, I
have 3 digit codes that have a country code, in column B, associated with it.
The 3 digit codes appear multiple times in the spreadsheet. I need a way to
show the 3 digit code and any and all of the country codes that are
associated with it on one row.

Example of my raw data below:
ABF CN
ABF MX
ABF US
ACC CN
ACC IE
ACC MX
ACC TW
ACC US

Desired Output:
Col A Col B Col C Col D Col E Col F
ABF CN MX US
ACC CN IE MX TW US


Satisfactory output:
ABF CN, MX, US
ACC CN, IE, MX, TW, US


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
How can I add multiple source data data labels? Julian Iles Charts and Charting in Excel 1 November 24th 08 11:58 PM
Setting hover data labels to cells other than source data Darren Charts and Charting in Excel 1 January 24th 06 10:20 AM
Setting hover data labels to cells other than source data Darren Excel Discussion (Misc queries) 0 January 24th 06 08:31 AM
renaming data labels by different cells than source data Darren Charts and Charting in Excel 4 January 12th 06 10:35 AM
How to find multiple cells/replace whole cells w/data dcurylo Excel Discussion (Misc queries) 2 November 30th 05 08:06 PM


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

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"