Extract the number in cell in Google sheets - google-sheets

The cell contains text that matches the following pattern: number, unit, item, description. How can I extract the number from the cell to the consecutive cell

To extract the start of the string up until the first comma:
=REGEXEXTRACT(A1,"^(.+?),")

Definitely not as neat as #AdamL's solution but alternatives:
=ARRAY_CONSTRAIN(split(A1,","),1,1)
=value(left(A1,find(",",A1)-1))

Related

Combining a Cell Reference and Wildcard as Criterion in Google Sheets CountIf Formula

I'm struggling with writing the proper syntax for this formula in Google Sheets. In one sheet called Game Log, in the H column I have data that can be a range of names (1 - 10 names per row). I'm trying to construct a COUNTIF statement that would search for the name in all the rows for that column. There can be several other names in the same column so I need to use the wildcard * to find any occurrence of the name in each row. So for example, the current code below would count all occurrence of Adam in the rows.
=COUNTIF('Game Log'!H3:H102, "*Adam*")
What I would like to do is replace the hard codes "Adam" with a cell reference (in this case B2). Is it possible to combine that cell reference with the wild card? The know the code below doesn't work (as it would return text counting occurrences of B2), but is something like this possible?
=COUNTIF('Game Log'!H3:H102, "*B2*")
Have you tried something like this?
=COUNTIF('Game Log'!H3:H102, "*" & B2 & "*")
That ought to look for any string value, followed by the cell value, followed again by any string value. It's essentially just performing separate checks, in sequence, which allows you to search for different value types (in this case string wildcard + cell value + string wildcard).

Find a string on a cell in table A and copy the found into another table B

Which formula can I use for this case?
I want to find with a formula a string (for example "koala"), which is a part of a larger string (for example "koalalalalo") which is in any column of line 2 in table A and copy the complete contents of the found cell in a cell of table B. Before that I don't know in which column the string will be therefore I need a formula which searches in all columns of line 2 to find the string.
use:
=HLOOKUP("*"&F1&"*"; Data!4:4; 1; 0)
But it gets me exact matches too
=HLOOKUP("*"&F1&"*"; FILTER(Data!4:4; Data!4:4<>F1); 1; 0)
You can use HLOOKUP and wildcards for example:
=HLOOKUP(search_key,range,index,[is_sorted])
References:
- HLOOKUP

Convert list of strings in line break to separate rows in Google Sheets

I need help to convert a string in a single cell in line breaks to separate rows. I've tried it copying the string in google sheet then paste in excel sheet it works but too tedious to do because there are many records.
Input:
cell A1 linebreak format without space
Apple
Banana
Grapes
Output:
A1=Apple A2=Banana A3=Grapes
you can do:
=TRANSPOSE(SPLIT(B1, CHAR(10)))

Split semi-colon separated values grouped within parentheses

My cell contains different "segments". Each parenthesis in the cell includes a budget, start date, and end date. I tried to work in Google Sheets.
What a typical cell would look like with multiple parentheses:
(14268.0; 10/18/2018; 10/28/2018;); (52377.22; 10/29/2018; 12/02/2018;); (17835.0; 12/03/2018; 12/15/2018;);
Is there a good way to split the budget and dates into their own cells?
From A1 across to B1:J1, if placed in B1:
=split(A1,"(,;) ")

Counting String Matches in a Range

Currently I'm using this formula to count the number of string matches in a range:
=COUNTA(FILTER(D3:D723,FIND(A1, D3:D723)))
If A1="am" and range has "ham", "scammy", "pan"; then the cell will display 2.
It appears to work correctly, except for one thing- it displays a match of 1 if there are no matches. How can I fix this?
You can use:
=COUNTIF(D3:D723,"*"&A1&"*")
It counts the amount of cells in D3:D7243 that have the substring in Cell A1. The * are there as a wildcard in front and behind the substring.
I made a working example for you as well to look at.
UPDATE: fixed statement
This is the formula you are looking for.
Formula
=COUNTA(IFERROR(FILTER(B:B,FIND(IF(A1="",(1/0),A1), B:B))),"")
Results
Search for A:
Search for empty string:
Search for am:
Example
I've created an example file you you: Counting String Matches in a Range

Resources