0

This is my LibreOffice Calc sheet, now I want to sort the ID in order of the RandomNum column. Now I want my sheet to fill the last Fullname column with the name of the person with the id from the first Fullname column. I hope someone understands what I want to do...

I want to refer the Fullname to its ID to keep this to together even if I resort.

Before sorting by RandomNum

| ID | Fullname | RandomNum | ID | Fullname (Fullname filled by first ID)
-------------------------------------------
| 1  | Jon Doe  |  0.0003   | 1  | Jon ...
-------------------------------------------
| 2  | Jane Doe |  0.0001   | 2  | Jane ...
-------------------------------------------
| 3  | Lee Bee  |  0.0002   | 3  | Lee ...
-------------------------------------------

After sorting by RandomNum

| ID | Fullname | RandomNum | ID | Fullname (Fullname filled by first ID)
-------------------------------------------
| 1  | Jon Doe  |  0.0001   | 2  | Jane ...
-------------------------------------------
| 2  | Jane Doe |  0.0002   | 3  | Lee ...
-------------------------------------------
| 3  | Lee Bee  |  0.0003   | 1  | Joe ...
-------------------------------------------
coderocket
  • 584
  • 3
  • 11
  • This is quite hard to understand. Am i right that there are two distinct datasets: `Set A`: `ID`, `Fullname`; `Set B`: `ID`, `RandomNum`? And the task is to assign the appropriate Fullname from `Set A to the RandomNum from `Set B` (based on identical ID)? – tohuwawohu Jul 01 '14 at 11:08
  • Yes, its a bit complicated and for me as not native english speaker a bit hard to explain :P The RandomNum is just to mix all the Names. You are right with the two sets. `Set A` will not be touched by the sort of the RandomNum from `Set B`. I want to "dynamicly" insert the Fullnames to `Set B` by its IDs (which are the same from `Set A`) ... maybe that helps to understand what I want to do. – coderocket Jul 01 '14 at 11:50
  • Ok, then it's essentially the same problem as http://stackoverflow.com/q/15686836/342546 - i recommend using the [VLOOKUP() function](https://help.libreoffice.org/Calc/Spreadsheet_Functions#VLOOKUP) ([as proposed in this answer](http://stackoverflow.com/a/16590520/342546)). Just split dataset A and B on different sheets and use VLOOKUP on dataset B to extract the appropriate name from Dataset A. – tohuwawohu Jul 01 '14 at 12:05

0 Answers0