Google Sheets - Parse Number / Currency - google-sheets

I have a spreadsheet in Google Sheets. I have a column with a set of strings e.g. '£3.36'. Now I wish for these to be treated as a number/currency and not as a string, as I am unable to mathematically manipulate them otherwise.
I have tried removing the £ by using =Right() and =LEN(), but unfortunately, sheets still considers them to be a string.
I have tried changing the format of the cell and selecting currency, but this does not work either.
I have also tried =TO_PURE_NUMBER(), but this didn't work for me either.
Has anybody got any suggestions?
All help is appreciated.

Scratch that. =right(x,len(x)-1) does actually work!

Related

Google Sheets, how can I remove or strip specified strings

I'm using Google Sheets and trying to figure out a formula that strips or removes specific strings. So a cell might have:
[url=https:website1]https:website1[/url] [url=https:website2]https:website2[/url]
and I want to convert it to
https:website1 https:website1
Each cell in the column will have different "websites" but the formatting will be similar. Any help is appreciated.
I've tried REGEXEXTRACT and SUBSTITUTE functions but can't seem to figure it out.
can you try:
=BYROW(A2:A,LAMBDA(ax,IF(ax="",,TEXTJOIN(CHAR(10),1,INDEX(REGEXEXTRACT(SPLIT(ax,"[url=",0,0),"[^\]]*"))))))

Google Sheet SUMIF returning an error! statement

pretty new to google sheets, my question could seems awkward but i'm struggling with a sumif in google sheets.
I'm using a sumif to sum up some values with a simple condition and i struggle to find the right way to do it. Assuming the documentation i do it well but i must be missing something because the result is always : ERROR!
See the example below
The example is simple, applying exactly what the documentation says but still not working.
I tried to make the cell format number for the condition, still not working.
I tried to make the condition a string by typing "=1", still not work. I tried to use a cell value in the condition B5 for example, still not working.. I'm desperate, i don't understand why this simple example is still not working.
If someone could help it will save my time.
Chances are that your spreadsheet is using a locale that expects formula arguments to be separated with semicolons instead of commas, like this:
=sumif(B5:B10; 1; C5:C10)
You can set the locale in File > Settings > Locale.

Formula parse error with AVERAGEIFS in Google Sheets

I want to calculate averages in a column but only on selected rows, depending on specific values in another column. I see that I should probably use AVERAGEIF or AVERAGEIFS, but somehow it does not work, not even if I copy and paste the example from Google's help. I did experience the same in multiple browsers and with both versions of the function. What can be the problem?
Do you need to adjust the formula for your locale?
=AVERAGEIFS(A1:A10;B1:B10;">20")

ARRAYFORMULA && Extract Num From String

Trying to use an arrayformula on google sheets to auto-populate a column which will extract the number from a string. I've found / made multiple methods of extracting the number from the string, but I can't seem to get it to work in an arrayformula.
This formula works perfectly to extract the text, but because it's creating an array it's not working within the array formula.
TEXTJOIN("",TRUE,IFERROR((MID(H13,ROW(INDIRECT("1:"&LEN(H13))),1)*1),""))
This below just won't work. I've tried multiple methods, but can't get it working. Clearly I'm making a circular reference, but I can't see to solve it.
=ARRAYFORMULA(IF(ROW(C12:C)=12, "Num", IF(ISBLANK(C12:C), "", TEXTJOIN("",TRUE,IFERROR((MID(H13:H,ROW(INDIRECT("1:"&LEN(H13:H))),1)*1),"")))))
Included is an example worksheet, with a column with expected output.
Thanks for your time! :)
Example Worksheet
What you could try, as I demonstrated in M13 on your sheet, is to use REGEXREPLACE() to remove anything from your data that is not a digit through "\D":
=INDEX(IF(H13:H="","",REGEXREPLACE(TEXT(H13:H,"#"),"\D","")))

Sum of referenced ranges in google spreadsheets

In Google spreadsheets, how do I find the sum of two ranges referenced from different spreadsheets
I want to use something like
=(IMPORTRANGE("keyofsheet1","A1:A100")+ IMPORTRANGE("keyofsheet2","A1:A100"))
and get the sum
Apparently, the above doesn't work. Any help would be appreciated :).
I have found an answer:
Arrayformula is what I was looking for. It basically applies the formula treating the range as a range, instead of as a single element. I still donot totally understand why this works. would be really happy if someone could explain this
I just used
ARRAYFORMULA((IMPORTRANGE("keyofsheet1","A1:A100")+IMPORTRANGE("keyofsheet2","A1:A100")))
and suddenly everything works as it should.
Shouldn't the + operator be conscious of the input type it is getting and automatically respond by returning the appropriate type? why do I need to explicitly specify that this is an array formula
I ran into a similar issue yesterday. Solution was:
=SUM(IMPORTRANGE("keyofsheet1","SheetName!A1:A100")) + SUM(IMPORTRANGE("keyofsheet2","SheetName!A1:A100"))
No need to use ARRAYFORMULA()
2 important notes.
You will probably see a #REF! error in your cell with a red color in the corner. You'll need to hover over it and allow access to the spreadsheets that you're referencing.
If any of the original data in the spreadsheet ranges you're referencing in A1:A100 contain errors such as
#NULL!
#DIV/0!
#VALUE!
#REF!
#NAME?
#NUM!
#N/A
then your formula must be modified to include SUMIF() as follows
=SUMIF(IMPORTRANGE("keyofsheet1","SheetName!A1:A100"), ">0") + SUMIF(IMPORTRANGE("keyofsheet2","SheetName!A1:A100"), ">0")
This ensures that it's only adding anumbers and not error codes.

Resources