I know this may work:
=ArrayFormula(sum(SUMIF(D2:D9&F2:F9,J2:J3&H2,E2:E9)))
But I don't know how to find any solution for this
=ArrayFormula(sum(SUMIF(D2:D9&F2:F9,J2:J3&(">"&H2),E2:E9)))
Basically, I want to SUMIF with multiple criterias with array formula. But I can't find a way with criteria that greater than something
this is the sample case: https://docs.google.com/spreadsheets/d/1lyPSurAudZOAn2HHGPaKcgmwso46f3K4dVYA6dwlDjM/edit#gid=0
the case is about summing the quantity given from each activity, given some range of date.
array formula is needed since I want the list of activity to be flexibly added, without me having to edit the formula.
as far as I know, sumifs cant be used because sumifs doesn't work with array formula
try:
=ARRAYFORMULA(SUM(IF((F2:F>H2)*(REGEXMATCH(D2:D,
TEXTJOIN("|", 1, J2:J))), E2:E, )))
or try:
=SUM(FILTER(E2:E, REGEXMATCH(D2:D, TEXTJOIN("|", 1, J:J)), F2:F>H2))
Some alternative:
sumif and vlookup==>
=arrayformula(sumif((1-isna(vlookup(D2:D9,J2:J3,1)))*F2:F9,">" & H2,E2:E9))
sum if and vlookup:
=arrayformula(sum(if((1-isna(vlookup(D2:D9,J2:J3,1)))*F2:F9>H2,E2:E9,0)))
Sum and vlookup:
=arrayformula(sum((iferror(vlookup(D2:D9,J2:J3,1),"")=D2:D9)*(F2:F9>H2)*E2:E9))
Related
The input is an array [Tuesday, Wednesday] but it is should be stored in one cell only.
Using this input I want to know how many days between two dates.
I found a reference but I don't know how to make it as dynamic because it only accept integer weekday.
https://www.extendoffice.com/excel/formulas/excel-count-day-of-week-between-two-dates.html
SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(start_date&":"&end_date)))=week_day))
Someone knows how to achieve this?
EDITED: input is okay in any format as long as it should inside in one cell only
within sheets you can try:
For count:
=INDEX(LAMBDA(aix,COUNTA(IFNA(FILTER(aix,REGEXMATCH(TO_TEXT(WEEKDAY(aix)),JOIN("|",MATCH(SPLIT(REGEXREPLACE(A5,"\[|\]",""),", "),TEXT(SEQUENCE(7),"DDDD"),0)))))))(SEQUENCE(DATEDIF(A2,B2,"d")+1,1,A2,1)))
For list:
=INDEX(LAMBDA(aix,IFNA(FILTER(aix,REGEXMATCH(TO_TEXT(WEEKDAY(aix)),JOIN("|",MATCH(SPLIT(REGEXREPLACE(A5,"\[|\]",""),", "),TEXT(SEQUENCE(7),"DDDD"),0))))))(SEQUENCE(DATEDIF(A2,B2,"d")+1,1,A2,1)))
use:
=SUMPRODUCT(REGEXMATCH(TEXT(SEQUENCE(DAYS(B2, B1)+1, 1, B1),
"dddd"), REGEXREPLACE(A4, ", ?", "|")))
I've followed the instruction, but it doesn't work in my situation and I wonder why.
This is the formula:
=ARRAYFORMULA(VLOOKUP(B12&""&C12,F11:H29,3,0))
Here's a doc with a situation for tests: File
Thanks!
try:
=ARRAYFORMULA(IFNA(VLOOKUP(B12:B29&C12:C29, {F11&G11, H11}, 2, 0)))
No helper column all at once
Paste this in K11 Sheet Example
=ArrayFormula(IF(G12:G="",,VLOOKUP({F12:F&" "&G12:G},{{F12:F&" "&G12:G}, E12:E} ,2,0)
))
With helper
Try this. add a helper column with the formula G11&" "&H11, and paste the following formula in K11
=VLOOKUP(B12&" "&C12,F11:I29,4,0)
If 1Item A and Cabeça do not change, you can even hardcode them to avoid any helpers.
=INDEX(IFERROR(VLOOKUP(B12:B29&C12:C29, {"1Item A", "Cabeça"}, 2, 0)))
I have a formula that do almost what I need. I'm trying to get a list of values with a condition depending about one value, is objetive 1 is equal or over to 80 show me the list of objetives equal or over 80. My formula is this one:
=ARRAYFORMULA(IF(('Product Prioritization Matrix'!C7:C >= 80), 'Product Prioritization Matrix'!B7:B,""))
My problem comes when I try to put this in just one cell in the last image will show what I need visualy.
The next images will show the sheets:
My formula
Expected result
I think a JOIN(... , FILTER( structure will work for this:
=JOIN(", ",FILTER(Sheet1!B:B,Sheet1!C:C>=80))
I am trying to use google sheet to create a roster formula, to sum up the duty hour per week using INDEX/MATCH/SUM.
But it's too long, is there any way to simplify the formula?
Also, I realize "MATCH" cannot recognize blank cell (N20), can that be fixed too?
=IFERROR(SUM(INDEX($O$12:$O$20,MATCH(D17,$N$12:$N$20,0)),INDEX($O$12:$O$20,MATCH(E17,$N$12:$N$20,0)),INDEX($O$12:$O$20,AND(F17,$N$12:$N$20,0)),INDEX($O$12:$O$20,MATCH(G17,$N$12:$N$20,0)),INDEX($O$12:$O$20,MATCH(H17,$N$12:$N$20,0)),INDEX($O$12:$O$20,MATCH(I17,$N$12:$N$20,0)),INDEX($O$12:$O$20,MATCH(J17,$N$12:$N$20,0))),"Err")
try:
=ARRAYFORMULA(MMULT(IFERROR(REGEXREPLACE(UPPER(B6:H14), "^"&TEXTJOIN("$|^", 1, L1:L10)&"$",
VLOOKUP(REGEXEXTRACT(UPPER(B6:H14), "^"&TEXTJOIN("$|^", 1, L1:L10)&"$"), L1:M10, 2*
SIGN(ROW(A6:A14)), 0)&""), UPPER(B6:H14))*1, TRANSPOSE(COLUMN(B:H))^0))
Franco, since your post says your end goal is to "sum up the duty hour per week," I take that to mean all you need in the end is a single number.
Try this (which will give you total hours for your block that runs B6:H22:
=ArrayFormula(SUM(COUNTIF(B6:H22,$L$1:$L$8)*$M$1:$M$8))
If you need to see the breakdown per code, you can use this:
=ArrayFormula({$L$1:$L$8,COUNTIF(B6:H22,$L$1:$L$8)*$M$1:$M$8})
Just replace "B6:H22" with the reference of each calendar block to get the sum or the breakdown for other weeks.
I have this example here
I need to have the data in column D filled in with arrayformula. The value should be the value in column B.
I've tried using combination of ROW&INDIRECT&FILTER&QUERY|VLOOKUP , but it didn't work, as if ROW() cannot be used in arrayformula. Maybe you guys have some idea that could work.
use:
=ARRAYFORMULA(IF(C7:C="",, VLOOKUP(ROW(A7:A), IF(B7:B<>"", {ROW(A7:A), B7:B}), 2, 1)))