Dynamic formula which Sums the Value if criteria is met - google-sheets

I have been working on sheet where i always apply SUM manual by selecting the each cell separately.
There are multiple sheets where i SUM manually with similar headers that are available in Col"A".
I just want to make SUM formula dynamic.
when it will become dynamic i will drag it from left to right and formula will give SUM result.
I have tried with IF but could not make it and i am sure its not just IF that could make it.

use:
=SUM(FILTER(B5:B, REGEXMATCH($A5:$A, TEXTJOIN("|", 1, $L2:$L))))

Related

Sum two ranges separately in one formula

How can I do one single formula to sum two ranges and display them in their respective column.
Here I'm using SUM formula in each cell but I'm sure there must be a single formula that can accomplish this.
Value 1 and Value 2 are the ranges to add them together in Sum row.
Here is an example picture.
Since arrayformula does not support sum, I suppose you could also do this in C12:
=arrayformula(C10:I10+C11:I11)
Clear the formula you have in row 12 and then enter in C12
=index(mmult({1,1}, --C10:I11))
Change range to suit and see if that helps?

Sum of cells containing a formula in google sheets

I want the sum of values in a column. However I wish to ignore cells which do not contain a formula. I tried
=SUMIF(A1:A10, ISFORMULA(A1:A10))
But that did not work
if its a small range you can do:
=SUM(FILTER(A1:A10, {ISFORMULA(A1); ISFORMULA(A2); ISFORMULA(A3);
ISFORMULA(A4); ISFORMULA(A5); ISFORMULA(A6);
ISFORMULA(A7); ISFORMULA(A8); ISFORMULA(A9); ISFORMULA(A10)})
This way might work for you.
I added a column with the following formula, which unfortunately also doesn't work as an arrayformula. But if you put this at the top of your column, beside the one you want to sum, and double click the "drag down" blue square on the bottom right corner of the cell, it will fill all the way down, provided you have no blank rows. Dragging down also works obviously.
=IFNA(FORMULATEXT(A1),0)
This creates a column of zeroes and text formulas, which you can use as a filter for your SUMIF formula, as follows: (assumes data column is A1:A30, helper column is B1:B30. SUMIF is in C1)
=SUMIF(B1:B30,"=0",A1:A30)
Let me know if this is useful, or not.

Using the same formula for each row in sheet

I want for every row in my sheet to calculate a score using a formula. So the same formula for each row. I tried this:
=ARRAYFORMULA(min((((C3:C100)/4)+((K3:K100)*4/10)+(M3:M100)+((N3:N100)/2.5)+((O3:O100)/5)+(R3:R100)+(T3:T100)+((P3:P100)/3)+(V3:V100))/23))
But it does calculate at all, for any row. (I am starting from row 3)
Why does it act like this? Any suggestions?
It's always best to provide us a link to your sheet, so we can see what you're trying to accomplish (or at least create a copy without sensitive data and share that).
If you want the same exact formula for each row, you will get the same exact result with your current formula. Also, do you mean to SUM the range values you have provided inside the formula? If so, you need to alter your formula to look like this:
=ARRAYFORMULA(min((((sum(C3:C100)/4)+(sum(K3:K100)*4/10)+sum(M3:M100)+(sum(N3:N100)/2.5)+(sum(O3:O100)/5)+sum(R3:R100)+sum(T3:T100)+(sum(P3:P100)/3)+SUM(V3:V100))/23)))
Please be more specific about exactly what you want the formula to calculate on each row. If it's on row 20, for example, do you still want rows 3-100 to be considered? Or just rows 20-100? WHAT data do you need to be considered on each row's formula, in other words?
Here's a sheet I created to try to understand what you want:
https://docs.google.com/spreadsheets/d/1GRdU6NLMWx2xPXDNp21VzYRQRj6cjNbL4RGVUV2x8Wk/edit?usp=sharing

Drag down the formula of IMPORTRANGE that changes the last value into increment value

I have an IMPORTRANGE formula in Google Sheets and want to apply it in the rest of the cells below. When I drag down the formula, it stays the same:
=importrange("1jhXCPi6RUf8MD7XoYgQsH-E0x768UtVxE3XY_kBrbkE","OCT!F2")
How can I drag a formula and have it automatically increment the value (OCT!F2 should be change into OCT!F3 up to OCT!F118)?
When I drag down this formula, I want it to be like this.
=importrange("1jhXCPi6RUf8MD7XoYgQsH-E0x768UtVxE3XY_kBrbkE","OCT!F3")
You may use row formula:
"OCT!F3" = "OCT!F" & row(A3)
You may also include the range in single importrange:
"OCT!F2:F500"
Be careful: importrange formulas may slow down your sheets.

Conditional formatting based on cells matching a column of another sheet

I've got a spreadsheet made on Google Sheets that contains 11 sheets, and each sheet is a set of things that I'm considering buying.
Some sets contain the same individual pieces as something else.
For example item A might be on sheet A and sheet D.
I'd like to make some kind of formula to highlight all duplicates, so that when I was looking through the sheet I could see whether buying item A will help me complete more than just the set that I'm looking at. So I can look at a set and if it's mostly green I know there's more value in buying it as almost all of the contents will also go towards another set.
I know how to do it so that they glow if they match on the same sheet.
$A2=$B2
However I'm not sure how to do it across sheets, or how I'd include if statements. As the colour would have to change if it matches any cells in column A on any sheet. They're also not in the same order on different sheets so while item A might be in A3 on sheet A, it might be in A17 on sheet D.
I'm not sure how possible something like this is, but I'd appreciate any help.
Google Sheets does not allow direct references to cells in other sheets in conditional formatting formulas. But this can be circumvented with indirect:
= A2 = indirect("Sheet2!A2")
formats the current cell (A2) if it's the same as the contend of A2 on Sheet2.
But you want to check whether the content is duplicated anywhere in column A of another sheet. This can be done with match: select the column A2:A of the present sheet, and add conditional formatting with custom formula
=match(A2, indirect("Sheet2!A2:A"), 0) > 0
Here match returns either the position of found element (a positive number) or #N/A, and the formula evaluates to True in the former case only.
Although the formula says "A2", it can be applied at once to any range that has A2 as its upper left corner.

Resources