Did not find value in MATCH evaluation - google-sheets

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

Related

How to get rid of the array size error in this scenario while using Countifs()

I have two columns and am trying to count the nonblank cells in column B based on a specific corresponding value in column A. So I am using COUNTIFS($A$3:$A,"GA",len(trim($B7:$B)),">0") to calculate that.
First criteria range is Column A and the criteria is if cell value equals "GA".
I want the second criteria range to be Column B and the criteria to be len(trim(cell)) > 0 but obviously I am not specifying it correctly and getting the following error, instead of the expected result of 7.
Please help in how I should achieve this.
Typo? Should be...
=COUNTIFS($A$3:$A,"GA",len(trim($B3:$B)),">0")
(You had $B7:$B.)
You can shorten this anyway:
=COUNTIFS(A3:A,"GA",B3:B,"<>")

Using number formatting on a scientific number changes the value

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+"))

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.

Google Sheets right() in Sum in Arrayformula returning false values

I've a column of sample data where each cell is either blank or (3 alpha chars, 1 white space, 1 digit). For example:
I need to check if the cell begins with "GTR" or "DBT", then return the number, and sum the return of the column. I'm using the formula below:
=ARRAYFORMULA(sum(IF(OR(left(A1:A10,3)="GTR",left(A1:A10,3)="DBT"),VALUE(right(A1:A10,1)),0)))
The problem is that instead of returning 20, it returns 52.
In fact it appears to return the last char of any cell in the range. (eg. if "A5" has a value of 'someText' the formula returns an error because value() can't parse 't' into a number.
I'd like to know if anyone can tell me how to solve this problem, or if there's something wrong with my formula?
Here's an example of this problem in a Google Sheet:
https://docs.google.com/spreadsheets/d/1XNVUWhI43UW2ABrja8rmplmxhhkSu-je45F-9F_3GQM/edit#gid=0
Thanks,
Onji
The ArrayFormula plus OR will evaluate to TRUE if any of the cells in the range is in the codition, to overcome this remove the OR, and add an IF for every condition, as such:
=ARRAYFORMULA(sum(IF(left(A1:A10;3)="GTR";VALUE(right(A1:A10;1));0);IF(left(A1:A10;3)="DBT";VALUE(right(A1:A10;1));0)))
In addition to the solution of Kriggs, this formula should also work:
=ArrayFormula(sum(if(regexmatch(B3:B12, "GTR|DBT")=TRUE, right(B3:B12)+0,)))

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