Grouping two cells together

  • Thread starter Thread starter andrewdgold
  • Start date Start date
A

andrewdgold

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!
 
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
 
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??
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top