Search through Google form data - google-sheets

I have a Google Form that outputs data like this:
Buyers sheet's row example (for each buyer who filled the form):
Timestamp | User 1 | Product 1 | Price 1 | Product 2 | Price 2 | Product 3 | Price 3 ...
Timestamp | User 2 | Product 1 | Price 1 | Product 2 | Price 2 | Product 3 | Price 3 ...
And on another sheet called Bids:
Product 1 | Base Price
Product 2 | Base Price
Product 3 | Base Price
The result I'd like to achieve is getting all the bids for the different products and display next to each product the highest bid with the corresponding username. I've tried with lookupv and query but did not succeed, I'm not exactly an expert in Google Sheets (that's an euphemism).
Any ideas?
Here is an copy of the actual sheet:
https://docs.google.com/spreadsheets/d/1bW_MlogHpXQk-_DZupE22No7KwUyZesqggsEdQaXPgw/edit?usp=sharing
With an example on the Bids sheet for computer of what I'm trying to get.
Buyers is a sheet populated automatically from a Google form.

use:
=ARRAYFORMULA(IFNA(VLOOKUP(A2:A, SORT(SPLIT(QUERY(FLATTEN(IF(
FILTER(Buyers!C2:1000, MOD(COLUMN(Buyers!C1:1)-1, 2)=0)<>"",
FILTER(Buyers!C2:1000, MOD(COLUMN(Buyers!C1:1)-1, 2)=0)&"×"&
FILTER(Buyers!C2:1000, MOD(COLUMN(Buyers!C1:1), 2)=0)&"×"&Buyers!B2:B1000, )),
"where Col1 is not null"), "×"), 2, 0), {2, 3}, 0)))

Related

Count values without having to specify each

I need to count how many times ids repeats, without having to specify each id. In my case I need it for know how many customers come 3 times or more in a month. Here is an example of where Im getting the data from:
customers| id
------------------
person 1 | 2433340
person 2 | 3457548
person 3 | 3457584
person 4 | 4343218
person 4 | 4343218
person 4 | 4343218
person 3 | 3457584
And this one is the one that I need to fill:
Times that customers come
--------------------------
1 time | 2
2 times | 1
3 times | 1
I have used:
Formula in D2:
=QUERY(QUERY(B2:B,"Select Count(B) where B is not null group by B label Count(B) 'Times'"),"Select Col1, count(Col1) group by Col1 label count(Col1) 'Count'")
I would work with a helper column (D) to count visits per person. Then it is pretty easy to count the "x times".
Values in column F are numbers formatted as "0 "time""

Use google query as an array formula to sum values in a column based on information in another column

I have 2 tabs needing worked with. The first tab, market_pull has a function that pulls information from EVE Online's ESI and sorts the information into several columns:
duration | is_buy_order | issued | location_id | min_volume | order_id | price | range | type_id | volume_remain | volume_total
The second tab, bulk_market_data sorts the information into several columns:
Citadel ID | Item Id | Item Name | Volume Ea | Qty Available | Lowest Price | Total Volume | Jita Sell | ISK Difference | % Difference
I need help with the bulk_market_data tab. I need to use the Item Id column from bulk_market_data as a criteria to compare to market_pull the column type_id pull the MIN value from the corresponding row in the price column.
I need to do essentially the same thing except I need to use the Item Id column from bulk_market_data as a criteria to compare to market_pull the column type_id pull the total SUM value from the all the corresponding rows in the volume_remain column.
I'm using array formulas because in the bulk_market_data tab there is about 10,000 rows and when I had a formula in every row for every column the sheet slowed down drastically. Thank you for your time and HERE is a sample spreadsheet with the concept.
use in F4:
=ARRAYFORMULA(IFNA(VLOOKUP(C4:C, QUERY({market_pull!C4:C, market_pull!J4:K},
"select Col2,sum(Col3) where Col2 is not null and Col1 = FALSE group by Col2"), 2, 0)))
use in G4:
=ARRAYFORMULA(IF(C4:C="",,IFNA(VLOOKUP(C4:C, SORT(QUERY({market_pull!C4:J},
"select Col8,Col6 where Col1 = FALSE"), 1, 1, 2, 1), 2, 0), 0)))
use in H4:
=ARRAYFORMULA(IF(C4:C="",,ROUNDUP(IF(
E4:E1004*F4:F1004=0,,E4:E1004*F4:F1004), 1)))

Google Sheets get an average value from unique values in a single column

On Google Sheets, I want to find an average for all values in rows that contain a unique value in one column.
For example, I have a sheet like this:
Dog | 2
Dog | 1
Dog | 4
Cat | 3
Rat | 2
Cat | 1
And I want to create another table below it for the average value of each unique value in the row:
Dog | 2.33
Cat | 2
Rat | 2
You can use
=QUERY(Data!A1:B7;"SELECT A, AVG(B) GROUP BY A")
assuming your data (containing titles) are on the A and B columns of the sheet.

Count unique values for unique dates in Google Sheets

I have a table that contains information on people who volunteered for multiple organizations over a one-month period. One person could have volunteered for the same organization on multiple dates, and multiple people could have volunteered on the same date. I'm interested in tracking, for each organization, unique volunteers (individuals who have volunteered at any point over the course of the month) and unique shifts (for the purposes of this data, a shift is one person volunteering on a unique date).
How can I pull the unique shifts metric? Here's an example of the type of data I'm dealing with:
Organization | Date | Volunteer
A | 10-01-2018 | Jane
A | 10-01-2018 | Ben
A | 10-02-2018 | Jane
B | 10-01-2018 | Emily
B | 10-02-2018 | Jack
You can see that Organization A has 2 unique volunteers and 3 shifts, while Organization B has 2 unique volunteers and 2 shifts. I'm able to get the unique volunteer count by using countuniqueifs with the organization as the criterion, but to get the number of shifts I need both the "Date" and "Volunteer" columns to be unique, while keeping the organization as the criterion.
I'm interested in tracking, for each organization, unique volunteers
=UNIQUE({A2:A, C2:C})
=QUERY(UNIQUE({A2:A, C2:C}),
"select Col1,count(Col2)
where Col1 is not null
group by Col1
label count(Col2)''", 0)
(individuals who have volunteered at any point over the course of the month)
=QUERY(UNIQUE(FILTER({A2:A, C2:C}, MONTH(B2:B)=10)),
"select Col1,count(Col2)
where Col1 is not null
group by Col1
label count(Col2)''", 0)
and unique shifts (for the purposes of this data, a shift is one person volunteering on a unique date)
=QUERY(UNIQUE(FILTER({A2:A, B2:B&C2:C}, MONTH(B2:B)=10)),
"select Col1,count(Col2)
where Col1 is not null
group by Col1
label count(Col2)''", 0)

In Google Sheets How do I get a sum of comma separated values in rows against an ID

I have a table which has a list of id's against names
Sheet 1
A | B
1 | Joe
12 | Dave
23 | Pete
I then have a table of rows which shows when a person was present at an event (through their ID)
Sheet 2
A | B
boston | 1
florida | 1,12
nyc | 12,23
In the 3rd sheet for appearances, I am then looking to achieve the following
Sheet 3
A | B (Appearances)
Joe | 2
Dave | 2
Pete | 1
I can get this to work when just one person makes an appearance with something like =COUNTIF(appearances!A:A, INDEX(name_db!$A$2:$A$1000, MATCH ($A11, name_db!$B$2:$B$1000, 0)))
But as soon as I add a comma value it all goes wrong.
I've tried looking into vLOOKUPS and things like that but can't seem to quite figure it out
Any help on where to look would be much appreciated
=ARRAYFORMULA(IFERROR(VLOOKUP(G:G, QUERY(VLOOKUP(TRANSPOSE(SPLIT(CONCATENATE(
IF(IFERROR(SPLIT(E:E, ","))<>"", "♦"&SPLIT(E:E, ","), )), "♦")), A:B, 2, 0),
"select Col1,count(Col1) group by Col1 label count(Col1)''", 0), 2, 0)))
This works for me:
=ARRAYFORMULA(IFERROR(SUM(SPLIT(D2;","))))

Resources