how can compare two cells in google sheets with multiple value in every cells and if even one value in two cells are same its show me match but if in two cells we do not have any same value show me not match.
for example I have these cells in my google sheets:
a1:[1,2,3,4]
b1:5,6,7
a2:[10,12,14,16]
b2:18,14,20
for these cell it should compare a1 and b1 and print not match in c1 then for a2 and b2 print match in c2 because a2 and b2 have a same value 14
you can try this arrayformula in Column C
=MAP(INDEX(REGEXREPLACE(A:A,"\[|\]","")),B:B,LAMBDA(ax,bx,IF(ax="",,IF(ISERROR(FILTER(SPLIT(ax,","),(MATCH(SPLIT(ax,","),SPLIT(bx,","),0)))),"FALSE","TRUE"))))
-
For not matching values-
=TEXTJOIN(",",1,LAMBDA(x,y,FILTER(x,NOT(ISNUMBER(XMATCH(x,y)))))(FLATTEN(SPLIT(SUBSTITUTE(SUBSTITUTE(A1,"[",""),"]",""),",")),FLATTEN(SPLIT(B1,","))))
For matching values-
=TEXTJOIN(",",1,LAMBDA(x,y,FILTER(x,ISNUMBER(XMATCH(x,y))))(FLATTEN(SPLIT(SUBSTITUTE(SUBSTITUTE(A2,"[",""),"]",""),",")),FLATTEN(SPLIT(B2,","))))
Edit: To show TRUE/FALSE try-
=INDEX(LAMBDA(x,y,OR(ISNUMBER(XMATCH(x,y))))(FLATTEN(SPLIT(SUBSTITUTE(SUBSTITUTE(A1,"[",""),"]",""),",")),FLATTEN(SPLIT(B1,","))))
Another approach, based on creating an intermediate 2D array of IFs for each pair of cells to be compared then summing the result; given the columns for comparison in A1:A & B1:B then placing this formula in C1 will spill as many results as required:
=arrayformula(iferror(map(A1:A,B1:B,lambda(a,b,if(sum(n(split(a,"[],")=flatten(split(b,"[],")))),"Match","No match")))))
I'm trying to write a formula in Google Sheets that will enable me to sum a range of values across columns, where I can manipulate the number of cells to be summed across the column with a variable. For example:
if my variable is 5, then I want to sum(D3:H3);
and if my variable is 9, then I want to sum(D3:L3)
Furthermore, I want a formula that I can drag across columns so that the range it's summing moves relative to the cell the formula is in. In the example above with the variable=5:
the formula in cell A3 would be sum(D3:H3);
and the formula in cell B3 would be sum(E3:I3)
etc.
I created a sample spreadsheet here for more context.
Thanks for reading!
I've added a sheet ("Erik Help"). See formula in B5:P5.
Here is the B5 formula (which was then dragged across to P5):
=ArrayFormula(SUM(FILTER($B$1:$1,COLUMN($B$1:$1)>(COLUMN()-$B$4),COLUMN($B$1:$1)<=COLUMN())))
There may be an array approach. But since you have such limited data, this is just as effective with less time investment required to develop the solution.
In plain English, the formula reads "Sum the numbers from B1:1 where the column is greater than X rows back and no greater than the current column" (where X is the value set in B4).
paste in column B and drag to the right:
=IF(COLUMN()-1<$B1, "-", SUM(INDIRECT(
ADDRESS(3, COLUMN()-($B1-1))&":"&
ADDRESS(3, COLUMN()))))
I would like to plot sparklines (barchart with the value to show in B-row and the max-value in die C-row: see linked file) in every cell from A2 to A5 using ony one arrayformula (=ARRAYFORMULA( ...) in A2 which can plot spakrlines in every cell from A2 to A5.
Link to file: sparkline arrayformula
Thx for any help,
Gerd
SPARKLINE does not work with arrayformula. I think the best you can do is put this in A2 and drag it down past A5. It will pick up new data.
=iferror(SPARKLINE(B2,{"charttype","bar";"max",C2}),"")
Hmm
Make a blank column A:A.
=ARRAYFORMULA(IF(ISBLANK($A$1:$A),"", SPARKLINE({0,1},{"color","#ddd"})))
Is it possible to conditionally hide rows and/or columns using formulas but NOT the API?
Example:
=IF(A1=0,HIDEROW(1),SHOWROW(1))
HIDEROW and SHOWROW are not native Google Spreadsheets functions and with that and using formulas but NOT the API I am not sure what you want, though the answer is likely ‘No’ regardless.
Alternatives may include a Google Apps Script, hiding the row content rather than the row itself (say with conditional formatting) and filtering the data – ie a copy of only the part you want visible. This might be with FILTER. For example with 0 and 1 alternating in A1:A4 of Sheet1 and B1 series filled in B1 to B4 then in A1 of another sheet:
=IF(F1=2,FILTER(Sheet1!B1:B4,NOT(ISBLANK(Sheet1!A1:A4))),FILTER(Sheet1!B1:B4,Sheet1!A1:A4=F1))
Should show B1 … B4 in that other sheet when F1 in that sheet is 2, just B2 and B4 when 1 and just B1 and B3 when 0.
I want to fill cells B2:D148 with =VLOOKUP(Sheet8!B2, Descriptions!A3:B, 2, FALSE), replacing B2 in the formula with the current cell. If I use that formula for B2, then series-fill to C2, I get =VLOOKUP(Sheet8!C2, Descriptions!B3:C, 2, FALSE). C2 updates successfully, but it also increments the lookup range, which should be static.
If I manually fix C2 and D2, then series-fill down to Row 3, it's closer, but the A3 reference still becomes A4, which doesn't work.
Is there any way to series-fill one reference in a formula but not the other?
Alternately, is there any way to reference "this" cell, something like =VLOOKUP(Sheet8!$THIS_CELL, Descriptions!A3:B, 2, FALSE)? If so, I could just copy that formula to the entire range.
Thanks!
Why don't you wrap your VLOOKUP in an ARRAYFORMULA() ?
In B2, try:
=ARRAYFORMULA(VLOOKUP(Sheet8!B2:D148, Descriptions!A3:B, 2, FALSE)
NOTE: you will have to make sure there are no othere values or formulas present in the range D2:D148