I need help with my spreadsheet
the spreadsheet looks something like this:
| Hostname | A header | Another header |
|---|---|---|
| host1-dns | text 11 | text 12 |
| host1-ftp | text 11 | text 12 |
| host1-ntp | text 11 | text 12 |
| host1-vip | text 11 | text 12 |
| host2-dns | text 21 | text 22 |
| host2-ftp | text 21 | text 22 |
| host2-ntp | text 21 | text 22 |
| host3-dns | text 31 | text 32 |
| host3-ftp | text 31 | text 32 |
| host4 | text 41 | text 42 |
| host5-sans | text 51 | text 52 |
I need to create a table eliminating duplicate hosts. In my table:
- host1-dns, host1-ftp, host1-ntp, host1-vip is just one host and should be counted once
- host names (prefixes) does not have uniform number of characters
- suffixes do not have uniform number of characters as well
- prefixes and suffices are separated by a hyphen
In the end, the table should look like this:
| Hostname | A header | Another header |
|---|---|---|
| host1 | text 11 | text 12 |
| host2 | text 21 | text 22 |
| host3 | text 31 | text 32 |
| host4 | text 41 | text 42 |
| host5 | text 51 | text 52 |
I am open to any implementation, formula, or macro.
Thanks in advance :-)

Add helper column with formula:
then use
Remove duplicatesdialog for last three column: