ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Grouping two cells together (https://www.excelbanter.com/excel-discussion-misc-queries/145999-grouping-two-cells-together.html)

[email protected]

Grouping two cells together
 
Here is the long story short. I have two columns, A is company ID#
and B is company name. I need to search through the company names to
find a certain one and when I find it, I must cut that cell with its
adjacent co. ID# cell and insert both cells into another location in
the worksheet.

My question is...can I possibly tag or group the co. name and ID cells
together?? Let's say I for some reason only cut the co. name cell by
accident, I want excel to understand that the ID# cell is grouped with
it and both will be cut automatically. Is there any easy way to do
this?? I know that I could "name" both cells and have the one name
refer to 2 cells...but thats a whole lot of extra work that doesn't
make sense to do.

Please let me know. Thank you!


Mike H

Grouping two cells together
 
One way of doing what you want is to put the Co name you are looking for in a
cell (say d1) and then in a cell next to it the formula:-

=INDEX(A:A,MATCH(D1,B:B,0))

The formula will look for the company in column b and reurn the id# from
column a.

Mike

" wrote:

Here is the long story short. I have two columns, A is company ID#
and B is company name. I need to search through the company names to
find a certain one and when I find it, I must cut that cell with its
adjacent co. ID# cell and insert both cells into another location in
the worksheet.

My question is...can I possibly tag or group the co. name and ID cells
together?? Let's say I for some reason only cut the co. name cell by
accident, I want excel to understand that the ID# cell is grouped with
it and both will be cut automatically. Is there any easy way to do
this?? I know that I could "name" both cells and have the one name
refer to 2 cells...but thats a whole lot of extra work that doesn't
make sense to do.

Please let me know. Thank you!



[email protected]

Grouping two cells together
 
Mike, thank you for the reply and the advice.

However, I do not think this will work for what I want to do because I
will be cutting and pasting both the co. names and IDs in different
places in the workbook, I just need to make sure they always stay
together (I'm basically manually resorting the list I have). That
formula will only tell me what co. ID is currently with the co. name,
not necessarily the one that is always supposed to go with the name.
Meaning...if I cut a name and forget to cut its ID# and insert the
name 4 cells up, it would replace another name (which its supposed to
do)...YET all of the another names below it will shift down meaning
every name is now next to its incorrect ID#. Now this index formula
would still tell me the ID# that is with the name I have just moved up
4 spaces, but this ID number will now be wrong. Does this make
sense??




On Jun 11, 10:32 am, Mike H wrote:
One way of doing what you want is to put the Co name you are looking for in a
cell (say d1) and then in a cell next to it the formula:-

=INDEX(A:A,MATCH(D1,B:B,0))

The formula will look for the company in column b and reurn the id# from
column a.

Mike



" wrote:
Here is the long story short. I have two columns, A is company ID#
and B is company name. I need to search through the company names to
find a certain one and when I find it, I must cut that cell with its
adjacent co. ID# cell and insert both cells into another location in
the worksheet.


My question is...can I possibly tag or group the co. name and ID cells
together?? Let's say I for some reason only cut the co. name cell by
accident, I want excel to understand that the ID# cell is grouped with
it and both will be cut automatically. Is there any easy way to do
this?? I know that I could "name" both cells and have the one name
refer to 2 cells...but thats a whole lot of extra work that doesn't
make sense to do.


Please let me know. Thank you!- Hide quoted text -


- Show quoted text -





All times are GMT +1. The time now is 09:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com