spreadsheet - Using Query command to extract, compare and list data -
i run music festival , data given ticketing provider extremely poorly laid out, in spreadsheet format vertical merges. data, use google sheets extract camping tickets other festival ticket types , allocate camping tent numbers. proposed solution is:
1: extract camping tickets using query commmand:
=query(ticketdata!a1:s50000, "select c,d,e, f, g,n, s contains 'season shared camping - 10 man tent'order c").
but query command must also:
2: compare results static sheet of existing allocations
3: display entries not in static existing allocations sheet.
thus query command shows new, unallocated camping ticket purchases need actioned. once placed in static sheet, entry automatically removed query sheet exists in both sheets.
unique identifier column c, , column contains text string identifies if camping ticket column s.
thank you
i imagine have downvote due not being excel question, being tagged so. either way think have solution.
writing complicated requirements query string can quite tough requires escaping string , weaving in cell references etc. can do part of work in 'data' section of query formula , use query string select columns want.
i've done using =filter , countif:
step 1: filter ticketdata using 'season shared...' string , static values with:
=filter(ticketdata!a:s, ticketdata!i:i = "season shared camping - 10 man tent", countif(ticketdata!c:c, static!c:c) > 0)
step 2: tie query, substituting above filter data section of query. need refer columns col1, col2 etc this:
=query(filter(ticketdata!a:s, ticketdata!i:i = "season shared camping - 10 man tent", countif(ticketdata!c:c, static!c:c) > 0), "select col3, col4, col5, col6, col7, col14, col19")
i tried on mock data , worked me. let me know how on.
edit: after looking @ data in comment looks filter needs altering static list different length other filter data. got round concatenating static ids (comma separated) , using find formula. if doesn't find picked iserr formula , comes through in filter:
=query(filter(ticketdata!a:s, ticketdata!i:i = $c$2, iserr(find(ticketdata!c:c, concatenate(transpose(shared!a:a&","))))), "select col3, col4, col5, col6, col7, col19")
you can see working on public data provided clicking here.
Comments
Post a Comment