rearranging data with values

hello, i have more documents with results for users in our group, i have added it into one document so i can work with it better. the thing is some users left and some new came so the rows and numbers do not match. i want to make a SUM of the numbers for each user - which is currently not possible because the data is not sorted. i wanted to make it work with pivot table but it does not match the users into rows. i would have to do it by hand. sample of the sheet is:

user1 number user2 number user3 number user3 number
user2 number user4 number user4 number user4 number
user3 number user5 number user6 number user6 number
user4 number user6 number user7 number user7 number
user5 number user7 number user8 number user9 number
user6 number user8 number user8 number user9 number

i want to make something like
user1 sum(all user1 values)
user2 sum(all user2 values)
user3 sum(all user3 values)
…
and so on.

because now i can only copy paste the values one by one and then do a simple SUM for each
but the rearranging of the data is the most time-consuming thing. so i’d like to know if there is a simpler way to do it. thanks in advance

ask117031.ods (21.0 KB)

1 Like

AI is not too bad to provide a python-ish perl-ish script to do that :wink:

otherwise SUMIFS function should do the trick.

I would suggest to reshape the sourcedata into 2 Columns… and use ⇒ Data ⇒ Pivottable…
( see first Sheet in attached Example )

If you prefer a solution based on Formulas, see second Sheet in the attached Example.

rearranging-data-with-values_117031.ods (17.9 KB)

@fpy Pretty stupid arrogant answer, right?

the conditional sum looks really nice, thank you.
could you please tell me in more detail what is doing that formula?
=SUM(IF($A$2:$G$7=A16,$B$2:$H$7,""))
A16 here is the name of the user

In case »it not obvious to you« what the Formula does? … thats one more reason to look how the Pivottable works!