How to convert a IFS formula with an ARRAYFORMULA - google-sheets

Could you please help me to convert this IFS formula in an ARRAYFORMULA?
The formula is:
=SUMIFS('CHICKEN USA'!$GF$11:$GF$1100;'CHICKEN USA'!$AO$11:$AO$1100;$B6;'CHICKEN USA'!$AP$11:$AP$1100;$C6;'CHICKEN USA'!$BP$11:$BP$1100;$D6;'CHICKEN USA'!$BU$11:$BU$1100;"First Quality")
Thank you for your help

Related

Apply complex formula to whole column using MAP or ARRAY FORMULA

This is a followup to my previous question.
#Martin and #rockinfreakshow helped me to convert the following formula using MAP and BYROW respectively.
Formula before conversion in F1 cell:
=if(Iferror(vlookup($D1, INDIRECT("$"&"A"&MATCH(E1,$B:$B,0)+1&":$B"),2,false),"")=E1,"",Iferror(vlookup($D1, INDIRECT("$"&"A"&MATCH(E1,$B:$B,0)+1&":$B"),2,false),""))
Formula solution in F1 cell:
=MAP(D:D,E:E,LAMBDA(d,e,IFERROR(IF(d="","",INDEX(FILTER(B:B,A:A=d,ROW(B:B)>MATCH(e,B:B,0)),1)))))
As I was expecting that the solution would be ARRAYFORMULA wrapping and I would convert the next formula by myself but that was not the case. So I am looking for your help to convert these:
Formula in G1 cell:
=if(or(Iferror(vlookup($D1, INDIRECT("$"&"A"&MATCH(F1,$B:$B,0)+1&":$B"),2,false),"")=E1,Iferror(vlookup($D1, INDIRECT("$"&"A"&MATCH(F1,$B:$B,0)+1&":$B"),2,false),"")=F1)
,"",Iferror(vlookup($D1, INDIRECT("$"&"A"&MATCH(F1,$B:$B,0)+1&":$B"),2,false),""))
and
Formula in H1 cell:
=if(or(Iferror(vlookup($D1, INDIRECT("$"&"A"&MATCH(G1,$B:$B,0)+1&":$B"),2,false),"")=E1,Iferror(vlookup($D1, INDIRECT("$"&"A"&MATCH(G1,$B:$B,0)+1&":$B"),2,false),"")=F1,Iferror(vlookup($D1, INDIRECT("$"&"A"&MATCH(G1,$B:$B,0)+1&":$B"),2,false),"")=G1)
,"",Iferror(vlookup($D1, INDIRECT("$"&"A"&MATCH(G1,$B:$B,0)+1&":$B"),2,false),""))
Now, my expectation is if we are able to find the solution for G1, H1 formulas, I should be able to replicate it for formulas in other cells I1,J1,K1..
I have linked a sheet for your testing:
https://docs.google.com/spreadsheets/d/13XLZvvdzK_mqr4Ous50cIEfernw2XrPJWvVgt1hFxtk/edit?usp=sharing
Any help is much appreciated.
That's a very heavy spreadsheet! You may try deleting all your data in E:AU and use this formula:
=ARRAYFORMULA(IFERROR (SPLIT(BYROW(D1:INDEX(D1:D,COUNTA(D1:D)),LAMBDA(v,TEXTJOIN(",",,FILTER(B:B,A:A=v)))),",")))
It joins the filtered values per row, and then splits them in your desired columns
I'm not sure what exactly the formula does but try this:
=ARRAYFORMULA(LAMBDA(res,if(res=E1:E11,,res))(XLOOKUP(D1:D11,A1:A11,B1:B11,,,-1)))

Google Sheet SUMIFS formula returning 0?

I have a SUMIFS formula in Google Sheets which is the following:
=SUMIFS('AWIN MASTER'!$AW:$AW,'AWIN MASTER'!$AT:$AT,">=" &A101,'AWIN MASTER'!$AT:$AT,"<" &A102)
This formula is the sum of a cost on another sheet, when the date is between two dates on the current sheet.
which is returning 0 when it shouldn't... it's working for my other formula but not mine... Could someone help please?
try:
=SUM(IFERROR(FILTER('AWIN MASTER'!AW:AW;
'AWIN MASTER'!AT:AT >= A101;
'AWIN MASTER'!AT:AT < A102)))
or see if you got the right conditions:
=FILTER('AWIN MASTER'!AW:AW;
'AWIN MASTER'!AT:AT >= A101;
'AWIN MASTER'!AT:AT < A102)
I found that it was because of formatting through IMPORTRANGE
Thank you all for your help!

Adapt a formula to ArrayFormula

Im very new to Google Sheets formulas.
Im trying to convert this formula:
=INDEX(PRX_ARM,MATCH(ELECTRICITE!E97,OFFSET(PRX_ARM_C1,0,MATCH(ELECTRICITE!G97,PRX_ARM_L1
,1)-1),1), MATCH(ELECTRICITE!G97&"1",PRX_ARM_L1,1))+
ELECTRICITE!H97*INDEX(PRX_REL,2,2)+
ELECTRICITE!I97*INDEX(PRX_REL,3,2)+
ELECTRICITE!J97*INDEX(PRX_BP_VOY,2,2)+
ELECTRICITE!K97*INDEX(PRX_BP_VOY,3,2)+
ELECTRICITE!L97*INDEX(PRX_BP_VOY,4,2)+
ELECTRICITE!M97*INDEX(PRX_BP_VOY,5,2)
So naturally, i converted every single cell reference to the range ArrayFormula must be applied to :
=ArrayFormula(INDEX(PRX_ARM,MATCH(ELECTRICITE!E90:E5030,OFFSET(PRX_ARM_C1,0,MATCH(ELECTRICITE!G90:G5030,PRX_ARM_L1,1)-1),1),
MATCH(ELECTRICITE!G90&"1",PRX_ARM_L1,1))+
ELECTRICITE!H90:H5030*INDEX(PRX_REL,2,2)+
ELECTRICITE!I90:I5030*INDEX(PRX_REL,3,2)+
ELECTRICITE!J90:J5030*INDEX(PRX_BP_VOY,2,2)+
ELECTRICITE!K90:K5030*INDEX(PRX_BP_VOY,3,2)+
ELECTRICITE!L90:L5030*INDEX(PRX_BP_VOY,4,2)+
ELECTRICITE!M90:M5030*INDEX(PRX_BP_VOY,5,2))
But it does not work.
Do you know what im doing wrong?
Thanks in advance.
Yu can't use index with arrayformula, use instead vlookup

ARRAYFORMULA FILTER VLOOKUP solution for multiple condition formula Google sheets

I need an ARRAYFORMULA, VLOOKUP or FILTER formula in K7 that:
Puts the date from A7:A IF the value in J7:J is >= E7:E AND <= F7:F AND D7:D = "Traverse"
I have got multiple solutions to work on the individual rows, but none to work as an array formula to effect the entire column.
=IF(AND(J7>=E7:E,J7<=F7:F,D7:D="Traverse"),OFFSET(J7,0,-9),"")
or
=IFERROR(FILTER(A:A,E:E<=J7,F:F>=J7,D:D="Traverse"))
or
=ArrayFormula(IFNA(vlookup(J7:J2064,Query(sort(filter({date("20"&left(A7:A,2),mid(A7:A,3,2),right(A7:A,2)),A7:G},D7:D="Traverse"),6,1,1,0),"Select Col6,Col2",0),2,1)))
an example sheet is here if anyone can shed any light :)
https://docs.google.com/spreadsheets/d/1SYbhfyIA2KoZF0k-TuIqm-Kn9L9o0I16EGbSXDaTABU/edit?usp=sharing
use:
=ARRAYFORMULA(IF((J7:J>=E7:E)*(J7:J<=F7:F)*(D7:D="Traverse"), A7:A, ))
update:
=ARRAYFORMULA(IFNA(VLOOKUP(J7:J, SORT({
FILTER({E7:E, A7:A}, D7:D="Traverse");
FILTER({F7:F+1,H7:H}, D7:D="Traverse")}), 2, 1)))
Thanks for your help, in the end I managed to get a formula working from someone on the Google help forum. This is a working solution if you're interested:
=ArrayFormula(IFNA(vlookup(J7:J,sort({filter({Register!E7:F,Register!A7:A},Register!D7:D="Traverse")
;if({index(sort(filter({Register!A7:A,Register!E7:E,Register!F7:F},Register!D7:D="Traverse"),2,1),0,2);""}
>{"";index(sort(filter({Register!A7:A,Register!E7:E,Register!F7:F},Register!D7:D="Traverse"),2,1),0,3)},
{{"";index(sort(filter({Register!A7:A,Register!E7:E,Register!F7:F},Register!D7:D="Traverse"),2,1),0,3)}+1,
{index(sort(filter({Register!A7:A,Register!E7:E,Register!F7:F},Register!D7:D="Traverse"),2,1),0,2);""},
iferror({index(sort(filter({Register!A7:A,Register!E7:E,Register!F7:F},Register!D7:D="Traverse"),2,1),0,2)
;""}/0,"")},)},1,1),3,1)))

Problem with Array Formula and Concatenate

I'm trying to build an array formula on google sheets for this :
=CONCATENATE(MID(C2,4,3),(MID(C2,1,3)),MID(C2,7,4))
The problem is that when I use array formula going from C2:C, it will concatenate all the rows at the same time, which is not what I want.
Does anybody know how to properly use the array on that case? So it will keep looking for just the value on C2, C3,C4 and so on?
Thank you!
Use the ampersand character instead of CONCATENATE:
=ArrayFormula(IF(C2:C="", "", MID(C2:C,4,3)&(MID(C2:C,1,3))&MID(C2:C,7,4)))

Resources