Using number formatting on a scientific number changes the value - google-sheets

I have a string which is eval_id = -8880305704784521238 in google sheet.
When I used split formula =SPLIT(A1,"=") it gives me result in scientific number
eval_id -8.88031E+18
But when I used number formatting it changes the value of the number.-8880305704784520000 which is not equal to the actual number -8880305704784521238.
How can I fix this issue.

Try this:
=REGEXEXTRACT(A1,"-*\d*.?\d+")
or as an array formula (specify the range):
=ARRAYFORMULA(REGEXEXTRACT(A1:A15,"-*\d*.?\d+"))

Related

Value imported can't be changed to a number

I'm using the function importhtml() on my Google Sheets :
=IMPORTHTML("https://fbref.com/fr/comps/13/Statistiques-Ligue-1";"table";3)
The data are imported but some data are displayed "01.08" and the value is a date. The other values are ok if they contains big number like 1.93. How it's possible to change that and have only numbers and not displayed that value as a date ?
I try to change the format of the cell but the value became a number like 44455.
This is a screen of what I have
Just with the importHTML without any cell formatting
After I format the cell as brut text
How can I have the value as a number so to display 1.08 and not 01.08 ( for Google SHeets this is a date )
Thanks a lot in advance
Just add a fourth parameter, which stands for locale.
=IMPORTHTML("https://fbref.com/fr/comps/13/Statistiques-Ligue-1";"table";3;"en_US")
This solved the problem here, since it turns the decimal points into commas, not allowing GS to interpret it as date format.

Did not find value in MATCH evaluation

My formula is supposed to grab numbers ranging from the cell H and then output numbers in cell I. However, I am getting an N/A error for some reason.
=INDEX({7,10,15,30,55,70,80,100,110},MATCH(H1,{0,4,8,15,25,35,45,55,65,70}))
Is there an error with the formula created?
Try changing the formula to this?
It looks like column H is being pasted/imported as text rather than number values. the "1*" will force it to a number if possible based on your locale.
=INDEX({7,10,15,30,55,70,80,100,110},MATCH(1*H1,{0,4,8,15,25,35,45,55,65,70}))
Alternatively, Try just formatting the Column as Format>Number>Automatic

Different Outputs while counting unique values in a Google Sheet

I have a google sheet which looks like this :
The formula for cell M3 is =COUNTA(UNIQUE(B3:L3)) which outputs the 01/10/00. However the cell B18 is =COUNTA(UNIQUE(B3:B17)) and its output is 15
I wanted to get this count of unique values in the range using the formula but can't figure out the cause of difference of the outputs. Also, the count of unique values in a row should be 11 which is not really reflected in M3 and any changes are not changing the value of the output either.
there is a combo formula for that called COUNTUNIQUE
=COUNTUNIQUE(B3:L3)
The formatting of M3 is probably set to Date and that's converting your number into that date view. Additionally, if you're getting a higher number than you expect in general, double check for trailing spaces that can trick the unique() function.

Preprocessing each cell in range in Google Spreadsheet Formula

I'm trying to sum a range of values, but the values in my range comes from a formula resulting in string values (string user input, number extracted with left()). This makes =sum(A:A) not work.
What I would like to do is something along the lines of =sum(value(A:A)), but I need value() to apply to each cell before they are all summed up.
I would like a general solution applicable to any preprocessing formula.
Try this one:
=sum(ARRAYFORMULA(--A:A))
BTW, you could also double minus each number before summing: = --left(B1) will give the number. If A:A contains text, then use =sum(IFERROR(ARRAYFORMULA(--A:A)))

How do I avoid the "#DIV/0!" error in Google docs spreadsheet?

I have a column with average(K23:M23) that starts out with #DIV/0! when the K23 through M23 cells are empty. Preferably I'd like to only do the average of cells that contain non-zero, non-blank values. I think it's possible using the query command:
https://docs.google.com/support/bin/answer.py?hl=en&answer=159999
But their example doesn't help me.
Wrap your formula with IFERROR.
=IFERROR(yourformula)
You can use an IF statement to check the referenced cell(s) and return one result for zero or blank, and otherwise return your formula result.
A simple example:
=IF(B1=0;"";A1/B1)
This would return an empty string if the divisor B1 is blank or zero; otherwise it returns the result of dividing A1 by B1.
In your case of running an average, you could check to see whether or not your data set has a value:
=IF(SUM(K23:M23)=0;"";AVERAGE(K23:M23))
If there is nothing entered, or only zeros, it returns an empty string; if one or more values are present, you get the average.
Wrapping the existing formula in IFERROR will not achieve:
the average of cells that contain non-zero, non-blank values.
I suggest trying:
=if(ArrayFormula(isnumber(K23:M23)),AVERAGEIF(K23:M23,"<>0"),"")
Since you are explicitly also asking to handle columns that haven't yet been filled out, and I assume also don't want to mess with them if they have a word instead of a number, you might consider this:
=If(IsNumber(K23), If(K23 > 0, ........., 0), 0)
This just says... If K23 is a number; And if that number is greater than zero; Then do something ......... Otherwise, return zero.
In ........., you might put your division equation there, such as A1/K23, and you can rest assured that K23 is a number which is greater than zero.
Check if the column has text format. Apply number formatting to the cells you're using in the average function.

Resources