Exact criteria match in a Arrayformula - google-sheets

I have a formula that work perfectly in google sheet except that the criteria in the sumif sections have to be case sensitive match.
=ARRAYFORMULA(IF(A:A="Account ID","Total",SUMIF('Report'!C2:C,A:A,'Report'!E2:E)+SUMIF('Report'!$B$2:$B,A:A,'Report'!$E$2:$E)))
I've try with EXACT and FIND but couldn't figure out how to make it work

Use FILTER, like this:
=MAP(A:A,LAMBDA(ζ,IF(ζ="Account ID","Total",SUM(FILTER(Report!E2:E,EXACT(Report!B2:B,ζ)+EXACT(Report!C2:C,ζ))))))

Related

ARRAYFORMULA and FILRER by a range

This formula by I2:I not work
in google sheets
=ARRAYFORMULA(IFNA(ifs(B2:B<>"",VLOOKUP(B2:B,FILTER(A!A1:F55,A!D1:D55=I2:I),2,false)),""))
In ARRAYFORMULA formulas like QUERY and FILTER not working with non static query (query to some cell without using cells in current talbe).
You must make all queries in ARRAYFORMULA as static.
May you share link to your example?

how can I write a formula that uses a cell's contents when building a range reference to the name of another sheet?

I have a large Google Sheets spreadsheet that has individual sheets for financial statements of activity for multiple years. I want to reference particular columns of those in other sheets, and I've successfully figured out how to do that with an HLOOKUP function. However, because I want to do this for multiple years, I'd like that HLOOKUP function to pick up the name of the sheet to reference from its column header. Right now, I'm hard-coding it like this—you can see the HLOOKUP range refers to cells in the "2021 Overall" sheet. The hard-coded approach works but makes adding a new year tedious. Ideally, the HLOOKUP formula would read the contents of its column header cell to determine which year it is.
As best I can tell, the solution is to use INDIRECT, but I can't figure out any way to build the formulate with INDIRECT and not get an error. For instance, this seemed like it should work. As you can see, I have 2021 in cell D4, and my INDIRECT statement is referencing that and building the rest of the range.
I've also tried using INDIRECT with an explicit CONCATENATE, with no more success.
Any ideas for how to look up that D4 cell and slide it into the HLOOKUP range?
Thank you!
Try to remove the "'"& before D4 and the ' after the Overall.
Your formula should look like this:
=IFERROR(HLOOKUP($A$2,INDIRECT(F4 &" Overall!$A$5:$X$150", Utility!$A10, FALSE)))
With Nikko's nudges in the right direction, I eventually figured out the right format. This allows the formula to work in multiple sheets and to be filled right (for more years) and down (for more classes).
=IFERROR(HLOOKUP($A$2,INDIRECT("'"D$4&" Overall'!$A$5:$X$150"), Utility!$A3, FALSE))
Note that if you try to replicate this, you may need to type the formula out from scratch—I had a problem where pasting it in didn't work. Once I'd retyped it and Google Sheets acknowledged it, it worked from then on in the spreadsheet, even when pasted from sheet to sheet.

How can I use the COUNTA in ArrayFormula?

I've been trying to use ArrayFormula & COUNTA functions to achieve the result below:
I want the result to be like this
I want to count the number of the words in each field, and I am trying to drag formula down automatically when the sheet has new fields. I came up with this formula: =ARRAYFORMULA(COUNTA(transpose(split(join(char(10),$A2),char(10)))))
But when I add in new fields, the automation doesn't work. I also try to replace $A2 with $A2:A but I still couldn't automate it.
The current situation
Any thoughts would be appreciated!
Here is something that may work for you if you put this in B2:
=INDEX(IF(A2:A="","",LEN(REGEXREPLACE(A2:A&CHAR(10),"\S+(\n)","1"))))

Google Sheets Countif range is greater than range

So, quite simply I am trying to count if B4>A4 and B5>A5... ect.
I could do something like this:
=COUNTIF(B4,">"&A4)+COUNTIF(B5,">"&A5)+...
There's got to be a better way using ranges. (Sorry if that formula doesn't actually work)
The formula I have right now:
=COUNTIF(B$4:B30,">"&A$4:A30)
(this is in cell B31)
I've tried many different ways of doing this, but none of them have worked so far. This includes:
-using COUNTIFS
-Having the range include A ("A$4:B30")
-Having the criteria contain both sides (B$4:B30&">"&A$4:A30)
-Not using quotes
-I tried using ARRAYFORMULA and that gave me a mess. But I'm also not that great with ARRAYFORMULA so I might be doing something wrong.
try:
=INDEX(SUM(N(B4:B30>A4:A30)))

How to show duplicates on 2 google sheets at the same time?

This conditional format command shows duplictes on the Sheet1 perfectly:
Appliy to range A:A
=COUNTIF(A:A,A1)>1
Is it possible make it work with Sheet2 at the same time. I've read that INDIRECT could help but I don't understand how to do that.
I tried this with no luck:
If you want it to check both sheets for duplicates, you can still use almost the same formula, but you have to put the references into an Indirect statement:
=countif(INDIRECT("Sheet1!A:A"),A1)+countif(INDIRECT("Sheet2!A:A"),A1)>1
as mentioned in the documentation

Resources