简体   繁体   中英

Grouping data in google sheets?

I want to know how I could group the information from google sheets such that I can form groups with 3 team members. I want to be able to copy information of a registrants details (if the number of team members is under 3) and then paste it into the column above such that it can form a team of 3. The sorted list should look something like this.

unsorted array sample

未排序的数组样本

sorted array sample

排序数组样本

I've tried using some google sheets functions such as VLOOKUP, what java/python APIs would you recommend to solve this problem.

"entry": [{
            "id": {
                "$t": "https://spreadsheets.google.com/feeds/list/1sjPsuoIZOJWRLLcJlvZbvKuHnGn6KfaqLLa3rpSXmR0/od6/public/values/cokwr"
            },
            "updated": {
                "$t": "2020-07-28T09:58:17.850Z"
            },
            "category": [{
                "scheme": "http://schemas.google.com/spreadsheets/2006",
                "term": "http://schemas.google.com/spreadsheets/2006#list"
            }],
            "title": {
                "type": "text",
                "$t": "Dan"
            },
            "content": {
                "type": "text",
                "$t": "registrantlastname: M, registrantsemailadress: dan@gmail.com, secondmemebersfullname: MatL, secondmembersemail: mal@gmail.com, thirdmembersfullname: Oscar, thirdmembersemailaddress: radio@hotmail.com, teammembers: 3"
            },
            "link": [{
                "rel": "self",
                "type": "application/atom+xml",
                "href": "https://spreadsheets.google.com/feeds/list/1sjPsuoIZOJWRLLcJlvZbvKuHnGn6KfaqLLa3rpSXmR0/od6/public/values/cokwr"
            }],
            "gsx$registrantfirstname": {
                "$t": "Dan"
            },
            "gsx$registrantlastname": {
                "$t": "M"
            },
            "gsx$registrantsemailadress": {
                "$t": "dan@gmail.com"
            },
            "gsx$secondmemebersfullname": {
                "$t": "MatL"
            },
            "gsx$secondmembersemail": {
                "$t": "mal@gmail.com"
            },
            "gsx$thirdmembersfullname": {
                "$t": "Oscar"
            },
            "gsx$thirdmembersemailaddress": {
                "$t": "radio@hotmail.com"
            },
            "gsx$teammembers": {
                "$t": "3"
            }
        }, {
            "id": {
                "$t": "https://spreadsheets.google.com/feeds/list/1sjPsuoIZOJWRLLcJlvZbvKuHnGn6KfaqLLa3rpSXmR0/od6/public/values/cpzh4"
            },
            "updated": {
                "$t": "2020-07-28T09:58:17.850Z"
            },
            "category": [{
                "scheme": "http://schemas.google.com/spreadsheets/2006",
                "term": "http://schemas.google.com/spreadsheets/2006#list"
            }],
            "title": {
                "type": "text",
                "$t": "Mariana"
            },
            "content": {
                "type": "text",
                "$t": "registrantlastname: Fake, registrantsemailadress: mari.fake@itesm.ru, secondmemebersfullname: Johnathan, secondmembersemail: jan@gmail.com, teammembers: 2"
            },
            "link": [{
                "rel": "self",
                "type": "application/atom+xml",
                "href": "https://spreadsheets.google.com/feeds/list/1sjPsuoIZOJWRLLcJlvZbvKuHnGn6KfaqLLa3rpSXmR0/od6/public/values/cpzh4"
            }],
            "gsx$registrantfirstname": {
                "$t": "Mariana"
            },
            "gsx$registrantlastname": {
                "$t": "Fake"
            },
            "gsx$registrantsemailadress": {
                "$t": "mari.fake@itesm.ru"
            },
            "gsx$secondmemebersfullname": {
                "$t": "Johnathan"
            },
            "gsx$secondmembersemail": {
                "$t": "jan@gmail.com"
            },
            "gsx$thirdmembersfullname": {
                "$t": ""
            },
            "gsx$thirdmembersemailaddress": {
                "$t": ""
            },
            "gsx$teammembers": {
                "$t": "2"
            }
        }, {
            "id": {
                "$t": "https://spreadsheets.google.com/feeds/list/1sjPsuoIZOJWRLLcJlvZbvKuHnGn6KfaqLLa3rpSXmR0/od6/public/values/cre1l"
            },
            "updated": {
                "$t": "2020-07-28T09:58:17.850Z"
            },
            "category": [{
                "scheme": "http://schemas.google.com/spreadsheets/2006",
                "term": "http://schemas.google.com/spreadsheets/2006#list"
            }],
            "title": {
                "type": "text",
                "$t": "Lorem"
            },
            "content": {
                "type": "text",
                "$t": "registrantlastname: Ipsum, registrantsemailadress: lorem@gmail.com, teammembers: 1"
            },
            "link": [{
                "rel": "self",
                "type": "application/atom+xml",
                "href": "https://spreadsheets.google.com/feeds/list/1sjPsuoIZOJWRLLcJlvZbvKuHnGn6KfaqLLa3rpSXmR0/od6/public/values/cre1l"
            }],
            "gsx$registrantfirstname": {
                "$t": "Lorem"
            },
            "gsx$registrantlastname": {
                "$t": "Ipsum"
            },
            "gsx$registrantsemailadress": {
                "$t": "lorem@gmail.com"
            },
            "gsx$secondmemebersfullname": {
                "$t": ""
            },
            "gsx$secondmembersemail": {
                "$t": ""
            },
            "gsx$thirdmembersfullname": {
                "$t": ""
            },
            "gsx$thirdmembersemailaddress": {
                "$t": ""
            },
            "gsx$teammembers": {
                "$t": "1"
            }
        }, {
            "id": {
                "$t": "https://spreadsheets.google.com/feeds/list/1sjPsuoIZOJWRLLcJlvZbvKuHnGn6KfaqLLa3rpSXmR0/od6/public/values/chk2m"
            },
            "updated": {
                "$t": "2020-07-28T09:58:17.850Z"
            },
            "category": [{
                "scheme": "http://schemas.google.com/spreadsheets/2006",
                "term": "http://schemas.google.com/spreadsheets/2006#list"
            }],
            "title": {
                "type": "text",
                "$t": "Ki"
            },
            "content": {
                "type": "text",
                "$t": "registrantlastname: C, registrantsemailadress: abc@live.com, teammembers: 1"
            },
            "link": [{
                "rel": "self",
                "type": "application/atom+xml",
                "href": "https://spreadsheets.google.com/feeds/list/1sjPsuoIZOJWRLLcJlvZbvKuHnGn6KfaqLLa3rpSXmR0/od6/public/values/chk2m"
            }],
            "gsx$registrantfirstname": {
                "$t": "Ki"
            },
            "gsx$registrantlastname": {
                "$t": "C"
            },
            "gsx$registrantsemailadress": {
                "$t": "abc@live.com"
            },
            "gsx$secondmemebersfullname": {
                "$t": ""
            },
            "gsx$secondmembersemail": {
                "$t": ""
            },
            "gsx$thirdmembersfullname": {
                "$t": ""
            },
            "gsx$thirdmembersemailaddress": {
                "$t": ""
            },
            "gsx$teammembers": {
                "$t": "1"
            }
        }, {
            "id": {
                "$t": "https://spreadsheets.google.com/feeds/list/1sjPsuoIZOJWRLLcJlvZbvKuHnGn6KfaqLLa3rpSXmR0/od6/public/values/ciyn3"
            },
            "updated": {
                "$t": "2020-07-28T09:58:17.850Z"
            },
            "category": [{
                "scheme": "http://schemas.google.com/spreadsheets/2006",
                "term": "http://schemas.google.com/spreadsheets/2006#list"
            }],
            "title": {
                "type": "text",
                "$t": "jane"
            },
            "content": {
                "type": "text",
                "$t": "registrantlastname: Ong, registrantsemailadress: j.ong@live.com, secondmemebersfullname: john Ong, secondmembersemail: j.ong@live.com, teammembers: 2"
            },
            "link": [{
                "rel": "self",
                "type": "application/atom+xml",
                "href": "https://spreadsheets.google.com/feeds/list/1sjPsuoIZOJWRLLcJlvZbvKuHnGn6KfaqLLa3rpSXmR0/od6/public/values/ciyn3"
            }],
            "gsx$registrantfirstname": {
                "$t": "jane"
            },
            "gsx$registrantlastname": {
                "$t": "Ong"
            },
            "gsx$registrantsemailadress": {
                "$t": "j.ong@live.com"
            },
            "gsx$secondmemebersfullname": {
                "$t": "john Ong"
            },
            "gsx$secondmembersemail": {
                "$t": "j.ong@live.com"
            },
            "gsx$thirdmembersfullname": {
                "$t": ""
            },
            "gsx$thirdmembersemailaddress": {
                "$t": ""
            },
            "gsx$teammembers": {
                "$t": "2"
            }
        }]
    }

This problem should be for a large dataset like this.

大型数据集

From here onwards, you can collect all who are in groups of 2 by selecting the filter icon in top right corner view and split them into groups of 1 using VLOOKUP and drag it down to repeat itself. 在此处输入图像描述

Finally, combine the 1s together and use HLOOKUP functions to get the correct names and indexes. For the team members just enter values (3,1,1). This will give you the array you want.

最后一步,向下拖动

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM