0

I'm trying to do a list of combinations of author IDs in the range of a publication. Example of data:

+--------+--------------+----------+
| PublID | Author       | AuthorID | 
+--------+--------------+----------+
| 1      | Author, A    | 1        |
| 1      | Foo, A       | 2        |
| 1      | Bar, C       | 3        |
| 2      | Some, A      | 4        |
| 2      | Else, B      | 5        |
| 3      | Writer, AB   | 6        |
| 4      | Smith, B     | 7        |
| 4      | Smith, C     | 8        |
+--------+--------------+----------+

The idea in pseudo code:

for every PublID
 for every first AuthorID
   copy it in the Source column
   copy the next AuthorID in the Target column 

so, this is what I'm after:

+--------+--------+
| Source | Target |
+--------+--------+
| 1      |  1     |
| 1      |  2     |
| 1      |  3     |
| 2      |  4     |
| 2      |  5     |
| 3      |  6     |
| 4      |  7     |
| 4      |  8     |
+--------+--------+

I'm familiar with VLOOKUP, and while at this case, I've also experimented with MATCH, INDEX and OFFSET - but if you can give any pointers on where to start and what to avoid, that'd help me a lot. I'd imagine that I'd first need to define the range, then within the range, do the lookup(s), and then define the range again.

Being a somewhat newbie with Excel functions, I'm not sure if I'd actually be better off with some VB macro solution instead. But, that'd be another story then.

2
  • 3
    The Source and Target columns are just a copy of the PublId and AuthorId columns. It's not that simple is it?
    – suspectus
    Commented Jul 24, 2013 at 9:15
  • 1
    Gosh! How could I miss such an obvious thing [blush]. Thanks, you are a genius.
    – tts
    Commented Jul 24, 2013 at 9:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.