Extract prices from string - google-sheets

I did a google form of items I'm selling, and the form is linked to a
google sheet. I want to extract the prices and add them in a separate column.
In the entries I have the price and name of the item, but I want to add only the prices
in the next column.
I was using:
=VALUE(RIGHT($D2, 4))
but that will only extract the price when there is one item.
Any information will be helpful!

SUM() doesn't care about text so you should be able to do:
=SUM(SPLIT(D2," ,$"))

Try
=sum(split(join("|",REGEXEXTRACT(substitute(A1,"$",""),REGEXREPLACE(substitute(A1,"$",""),"(\d+.\d+)","($1)"))),"|"))

Related

How to run function to split cell data when row added from jotform to google sheet

Firstly thanks for taking the time to look at this, I'm a basic spreadsheet user and what I'd like to achieve here is way over my capability.
I'm using a jotform that collects data on bird sightings (user name, date, species, geolocation), a widget in the form grabs the phone location Latitude & Longitude and concatenates it into one cell (geolocation) with a comma separator eg(56.58542, -5.34016).
When the form is submitted it adds a new row to a google sheet, the sheet has 4x columns [user name] [date] [species] [geolocation].
When a new row is added by the form I'd like to automatically add two extra cells in that row [Latitude] [Longitude] that contain the Lat & Long split into them eg[56.58542] [-5.34016]. I can manually do this with the =SPLIT() function but I'd like to do this automatically as the row is added.
Is this possible and can someone either point me to where I can learn how to do this or post the information here?
Yes it's possible with an ARRAYFORMULA() written in row 1. it would look something like this. Lets say the columns you're looking to populate are L and M. And that your Lat Long is currently in column K. in cell L1, you would write just this one formula. No headers above it, JUST this.
=ARRAYFORMULA({"Lat","Long";IF(K2:K="",,SPLIT(K2:K,", ",0))})
Hope that helps.

Searching for values with formulas

I need to make a list of which student is taking what kind of exam on which date and time.
The sheet with all the data looks like this:
This is per student but not per date.
I would like to have a tab per exam AND time. So exam Dutch is taken at 06-06-2019 at 10:00h, 12:00h and 14:00h. Tabs should be like: tab1 all students that take exam Dutch at 06-06-2019 10h, tab2 all students that take exam Dutch at 06-06-2019 12h, etc.
The order of columns can't change because the sheet as in the example is also generated with formulas etc. from other sheets.
I tried the VLOOKUP formula but this can't search on the left. I have absolutely no idea how to solve this.
I'm not looking for a ready to use answer. Just push me in the right direction.
You could use filter() or query().
Assuming 'achternaam' in column A and 'exam Dutch' is in column E, you can try
=query('SheetwithData'!A:E, "Select A where E contains '06-06-2019 10:00'", 1)
Replace the sheet name with the actual sheet name.

How can I compare strings and sort them accordingly using an auto-generated Google Forms response sheet?

So my goal is to have every name on the roster in column A and then have the names of those who respond (not everyone will respond) in column B. I want column A to sort alphabetically. I want column B (and the corresponding columns with answers (C-E)) to only fall in line if the name matches. Otherwise columns B through E would be left blank. Any help would be appreciated. Thanks!
Make a new sheet with the roster names. After typing them, use the Google Sheets sorting tools to sort them.
Use the match function to identify the corresponding row in the first sheet for each of the roster names.
Once you have got the row, you can get the data for any cells in that row. See Get content of a cell given the row and column numbers .

How can I filter my search in a column on google sheet which collects data from a form?

I would like to perform a multi criteria search of data in a column- contains data of check boxes(more than one option chosen).
For a clearer picture of what I am trying to do, screenshot below is a question in a form
Data from the form are saved in sheets like below,
So my concern here is if I would like to search/filter for the rows that contain "Commercial", the rows with Commercial,Engineering doesn't show up. That's definitely not an effective search.
Any advise on how can I go about this issue is kindly appreciated. If
Let's say you have your form in the response sheet in columns A to P, with the multiple choice in col D. If you want to filter your data on the word 'Commercial' you can either do:
=filter(A2:P, regexmatch(A2:P, "Commercial"))
or use query():
=query(A2:P, "select * where B contains 'Commercial' ")
Note: depending on your locale you may have to change the commas to semi-colons in order for the formulas to work.
I hope that helps ?
Following JPV's answer, I developed a line to make the query useful if you want to cross two categories. Let's suppose that someone in your checkbox example had picked all the options (IT, HR, Commercial, Engineering); and that you have created the cell with the dropdown option box in cell B1 with all your options, as JPV said.
Then, you want to filter and see all the people who had chosen IT and Commercial. You would, for that, create a second cell with the dropdown option box in, lets say C1; and then your query would be:
=query(A2:P, "select * where B contains '"&B1&"' and B contains '"&C1&"' ")
=FILTER(MOBILE!A2:E2000, ISNUMBER(SEARCH(A1,MOBILE!A2:A2000)))
SEARCH function will return a number of the position of the searched word (A1) in the searched strings in range (MOBILE!A2:A2000).
If the result of search is a number (ISNUMBER), then filter will return the TRUE rows result from the range MOBILE!A2:E2000.

Multiple criteria in a filter/summation combined, entered into two columns for sorting

I have a spreadsheet that tallies sales over time, including sales person, office they work out of, and the price of whatever it is that they sold. I am attempting to create a two-column filtered list by multiple criteria. The data looks like this:
Date Name Office Price
5/5/12 Joe OW 220000
6/1/12 Jim SOL 100000
What I want to be able to do is create a two-column entry that sums the price column, but uses multiple critera from the first three to do so. For instance, "everyone named Jim who sold something in May", and then I'd like to sort that by the top three.
Using items like:
=FILTER( C1:C ; D1:D="OW"; month(B1:B)=month("5/12/12"))
and
=ARRAYFORMULA(frequency(MATCH(E1:E&counta(E1:E),UNIQUE(E1:E&counta(E1:E)),0), MATCH(UNIQUE(E1:E&counta(E1:E)),UNIQUE(E1:E&counta(E1:E)),0)))
I can filter and tally, but I am unable to replace the frequency mentioned above with a summation of the price column.
Rather than using FILTER you could put together something using SUMPRODUCT:
=arrayformula(sumproduct($E$2:$E$3*($C$2:$C$3=C2)))
If you have column E as price and column C as name, this creates a new column that shows the total earnings for each name, next to every instance where that name appears in the array. You can apply further conditions within the SUMPRODUCT call as needed. You could then apply UNIQUE to deduplicate and sort the resulting table to see the top 3.

Resources