Question: I have an excelsheet with one column F with different values for example:

`Terry, Monica, Thomas, Eric, Susan, Martha, Gary` 

and so on. Approx 5000 rows with 250 different values.

Now I want to group these values in column A. 

For example:

* Group1: Thomas, Gary
* Group2: Eric, Susan
* Group3: Monica, Terry, Martha

and so on. 

I dont want to sort and filter the values because I fill the sheet with new values everyday. I have thought about an IF statement but that doesn´t work. 

Any ideas?

Answer: 
First create a small table that has the names and the desired groups:

[![enter image description here](https://i.stack.imgur.com/ngLPR.png)](https://i.stack.imgur.com/ngLPR.png)

Then just use VLOOKUP to equate the list with the desired group:

```
=VLOOKUP(A1,$H:$I,2,FALSE)

```

[![enter image description here](https://i.stack.imgur.com/jOfRu.png)](https://i.stack.imgur.com/jOfRu.png)
It sounds like you want column A to "detect" the available values from column F and generate groups from that. Although it might be possible to create a function that accomplishes what you want, Sort and Filter might turn out to be the most *convenient* tools for doing this.

If you [enable the Developer tab](https://msdn.microsoft.com/en-us/library/bb608625.aspx), you can click Record Macro, assign a Shortcut Key, and then perform the chore of sorting and filtering the values one time. Tomorrow, when you refill the same sheet with new values, you can simply run the macro again in an instant with its shortcut key.

If what you want to do turns out to be too sophisticated for a macro to successfully perform the correct actions the same way every day, you can customize the automation with Visual Basic for Applications (VBA). The quickest way to jump into VBA is to complete the recording of a brief macro, then click the Macro button on the developer tab again, then select your new macro from the list and click Edit to see the underlying code. 

To have folks help you with complex functions or VBA, however, you'd probably need to share more details about the layout of your spreadsheet and exactly how you'd like the output to appear.