Google Sheets Countif with multiple criteria - google-sheets

In a Google Sheet am trying to count the occurrences of a value ("R") in a row (11) where the same column in a different row (4) has the value ("Future") ie in how many columns do I have "R" and "Future".
My current formula is
=countifs(M11:BM11,"R",M$4:BM$4,"Future")

try:
=COUNTA(IFNA(FILTER(M11:BM11, M11:BM11="R", M4:BM4="Future")))

Related

Google Sheets Conditional Formatting By Compare Two Columns From Different Worksheets

I am having data in two different sheets i.e. Sheet1 Col A and Sheet2 ColA, I want to highlight value in Sheet1 if the count of that value in Sheet1 is less than the count in Sheet2. E.g. in Sheet1 the count of number 1 is 5 and in Sheet2 the count of number 1 is 7 thus 1 should be highlighted in Sheet1. For ease of reference am sharing the image as well as the link of the sheet with desired result.
https://docs.google.com/spreadsheets/d/1bFhqJ_RIzf9J5vLD3PxTxSkv0KtNp1-xW6IxD_I8b4k/edit#gid=143258355
Any help on above will be greatly appreciated.
use:
=COUNTIF($A$2:$A,$A2)<COUNTIF(INDIRECT("Sheet2!A2:A"), $A2)

How to use 1 formula to Count items by date?

https://docs.google.com/spreadsheets/d/1_b-wdVQFKKSpJtNF4coNhQvmv20mUFSGkpppbOTE9Cg/edit?usp=sharing
Hi, I am trying to build a report. How can I write 1 formula at B2 to count the SKUs by date? Thank you so much for your help.
See my added sheet ("Erik Help"). The formula in B2:
=ArrayFormula(IFERROR(VLOOKUP(FILTER(A2:A,A2:A<>"")&"~"&FILTER(B1:1,B1:1<>""),QUERY({Data!D2:D&"~"&Data!A2:A},"Select Col1, COUNT(Col1) GROUP BY Col1"),2,FALSE)))
The FILTERs aren't strictly necessary, but they will speed up processing, especially if you have a lot of data in your real sheet.
Every element from A2:A (the SKUs) is concatenated with a tilde ~ and then every element of B1:1 (the dates).
QUERY forms a two-column grouping of each SKU~date and COUNT of each from the Data sheet.
VLOOKUP then acts on every element of the virtual array grid, trying to find it within the QUERY. If found, the COUNT is returned. If not, IFERROR returns null.

Array formula with filter and index values depending on countif

I need an array formula only in column Date_2 with results like on screenshot and that will
insert last day of month depending on Date_0 (if bunch of Color&Fruit&Meal doesn't repeat in table)
insert first minimum date of column Date_1 (if bunch of Color&Fruit&Meal repeats first time) - 1
insert second minimum date of column Date_1 (if bunch of Color&Fruit&Meal repeats second time) - 1
and so on...
Is is possible to solve it with array formula?
I've tried but I can't..
=ArrayFormula(IF(A2:A="","",IF(COUNTIF(B2:B&C2:C&D2:D,B2:B&C2:C&D2:D)>1,INDEX(FILTER(B2:E,E2:E<>""),1,4),EOMONTH(A2:A,0))))
Google Sheets
I'm not quite sure what you need for Date_1 but try this arrayformula in cell F2 for Date_2:
=ARRAYFORMULA({"Date_2";if(IF(B2:B&""&C2:C&""&D2:D<>"",if(A2:A<>"",COUNTIFS(B2:B&"|"&C2:C&"|"&D2:D,B2:B&"|"&C2:C&"|"&D2:D,ROW(A2:A),"<="&ROW(A2:A)),),)=1,eomonth(A2:A,0),)})
I've added a duplicate sheet ("Erik Help") with the following formula in F1:
=ArrayFormula({"Date_2";IF(A2:A="",,IFERROR(VLOOKUP(B2:B&C2:C&D2:D&TEXT(COUNTIFS(B2:B&C2:C&D2:D,B2:B&C2:C&D2:D,ROW(A2:A),"<="&ROW(A2:A))+1,"000"),{B2:B&C2:C&D2:D&TEXT(COUNTIFS(B2:B&C2:C&D2:D,B2:B&C2:C&D2:D,ROW(A2:A),"<="&ROW(A2:A)),"000"),E2:E},2,FALSE)-1,EOMONTH(A2:A,0)))})
This formula creates the header (which you can change within the formula) and all results for Column F.
To lookup the "next instance of the group if there is one," I just wrote the formula to VLOOKUP that grouping plus a text rendering of the COUNTIFS-as-of-that-row-plus-1 for that grouping within a virtual array of each-grouping-plus-unique-count-thus-far in one column and the E2:E data in the next column. For instance, for Row 2, the formula VLOOKUPs redapplepie002
(002 being the text rendition of 001, which is the count of redapplepie as of row 2).

Arrayformula not working with index and match google sheets formula

I have data in three columns. Column A contains a list of fruits. The second column the rank (1,2,3...) and the third column a list again but this time ordered by preference.
I want to return the rank in the fourth column. I have tried this formula which works as it should but it's returning just one value yet it's an array formula. What could be missing?
=ARRAYFORMULA(index(B2:B11,match(A2:A,C2:C11,0)))
Link to my spreadsheet.
https://docs.google.com/spreadsheets/d/1e7xCcdPa3MywDVs70o2kXAwMnzJRMDuucktWPowS_MY/edit?usp=sharing
Index doesn't work with array formulas so you have to use Vlookup instead:
=ArrayFormula(if(C2:C="","",vlookup(C2:C,A2:B,2,false)))

How to count cells that contain word in Google Sheets?

I have in Google sheet plenty of columns and I have about 15,000 rows, I want to count how many cells contain "NA" these 2 letters in column F.
try simple COUNTIF like:
=COUNTIF(F:F, "NA")

Resources