Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Keep row columns together

$
0
0

I have a sheet that looks like this:

+-------------+|        Name |+-------------+|        John |+-------------+|       Aaron |+-------------+|        Kyle |+-------------+|        John |+-------------+|        Lucy |+-------------+|       Aaron |+-------------+

In another sheet, I have the following:

+-------------+-------------+|       Names |     Group # |+-------------+-------------+|        John |           1 |+-------------+-------------+|       Aaron |           3 |+-------------+-------------+|        Kyle |           2 |+-------------+-------------+|        Lucy |           4 |+-------------+-------------+

In the first column, Names, I have the following formula:

=ARRAYFORMULA(IFERROR(VLOOKUP(UNIQUE(Sheet1!A2:A), Sheet1!A2:A, 1, 0)))

Which adds the name in the first column of sheet 1 into the first column of sheet 2 as long as it's not a duplicate.

However, I've discovered that if I delete a row in the first sheet, let's say the first row where Aaron appears, it changes the results on the second sheet to:

+-------------+-------------+|       Names |     Group # |+-------------+-------------+|        John |           1 |+-------------+-------------+|        Kyle |           3 |+-------------+-------------+|        Lucy |           2 |+-------------+-------------+|       Aaron |           4 |+-------------+-------------+

How can I link/pair a row's cells so they stick together when something in the first sheet changes?

Here is a link to my spreadsheet:

https://docs.google.com/spreadsheets/d/1qJ6ox8-seaY3YOtTvYkVL1fNChTGKj3GHlq9AGWtOVY/copy?usp=sharing


Viewing all articles
Browse latest Browse all 9782

Trending Articles