The following formula works, but I'd like to simplify it:
=SUMIFS(Availability!D:D,Availability!C:C,A6,Availability!B:B,"FE")+SUMIFS(Availability!D:D,Availability!C:C,A6,Availability!B:B,"BE")+SUMIFS(Availability!D:D,Availability!C:C,A6,Availability!B:B,"QA")
I would expect the following to work, but I only get the total of FE. I want Availability!B:B to return when it's either FE BE or QA.
=SUMIFS(Availability!D:D,Availability!C:C,A6,Availability!B:B,{"FE","BE","QA"})
You could use a query instead
=SUM(QUERY(Availability!A:D,"select D where C='"&A6&"'and B matches'(FE|BE|QA)'"))
Functions used:
QUERY
SUM
Related
I have data in google sheets, looking like this:
A
B
C
D
E
F
G
TP
14656
18885
14317
19312
13303
14311
FN
12216
20107
14066
16323
11180
3478
and I want to implement the following formula:
which would manually look like this:
=(B1/(B1+B2))+(C1/(C1+C2))+...+(G1/(G1/G2))
However, I need this formula to be scalable. I've tried to use ARRAYFORMULA and SERIESSUM but could not manage to actually iterate over the row. Does sheets even support this, and if so, how does sheets implement iterating sums?
You can do the following:
=Sum(ArrayFormula(B1:G1/(B1:G1+B2:G2)))
Update:
If you want the range to be dependent on a manually entered j, use:
=Sum(ArrayFormula(Indirect("R1C2:"&"R1C"&j+1,0)/(Indirect("R1C2:"&"R1C"&j+1,0)+Indirect("R2C2:"&"R2C"&j+1,0))))
This assumes that the table in your post starts in A1 (R1C1).
I have created a sheet that generate random math questions. I'm having issue create automated answers.
google sheet concat not working
issue example 2
How do I get the result in F6? In another word, how do I get 111 in F6 instead of the math 30+81"?
If you want to get the sum of the two numbers you must use the SUM() formula in the cell you want it to get the result.
The SUM() formula is used as follows:
=SUM(number_1,number_2,number_3...)
In your case the formula would be:
=SUM(B6,D6)
After your comment:
You can use the IFS formula, its a bit tricky but it would work.
The syntaxis is this:
IFS(condition1, value1, condition2, value2, …)
To do what you want you should implement something like this:
=IFS(C6="-"; B6-D6; C6="+"; B6+D6;C6="/"; B6/D6; C6="*"; B6*D6)
This formula will check the cell operator and depending on it will perform one action or another.
You may try QUERY() function with a helper column, like this-
=query(,"Select "&D1&" label "&D1&" ''",0)
Alternatively, without a helper column, the formula would be-
=query(,"Select "&A1&B1&C1&" label "&A1&B1&C1&" ''",0)
Im not sure where I am making a mistake here. In the following sheet
https://docs.google.com/spreadsheets/d/1h0XR399z6OHqzyX509WwnLBiqHX4nq4FmofaJd-HoAw/edit?usp=sharing
Sheet 1 has the raw data. I am trying to sum the same in sheet based on different criteria but I am getting an issue with a simple query. In sheet order_payment_heads a simple sum query in C2 returns the su but also the text sum amount.
Feels like I am doing something really basic wrong here but any help would be great. query being used is given below
'''=QUERY(Sheet1!A:X,"select SUM(O) where H = '"&A2&"'",1)'''
in a brand new tab, try this in cell A1
=QUERY(Sheet1!A:X,"select H,V,SUM(O) where H is not null group by H,V label SUM(O)'Price Head'")
Hopefully that will get what you're after in one go. "group by" is really the only reason that query distinguishes itself from other functions.
I've been working at this for a bit.
I have tried many times different formula combos, using VLOOKUP to using INDEX & MATCH, even with an ARRAYFORMULA.
What I'm attempting to do is match a territory to return a state. Then be able to copy the formula down.
As of now when I copy the formula downwards it can only return the first find in the column.
Where did I go wrong? I'm sure this far too simple and I'm overthinking the entire thing.
I was hoping for something like the following formula to work:
=ArrayFormula(index(States,Match(TER 1,Territory,0)))
=ArrayFormula(index($D$3:$D$53,MATCH($B$3,$C$3:$C$53,0)))
Try a query instead. In cell F4 try the following formula:
=IFERROR(QUERY($C$3:$D$52,"select D where C='"&G$3&"'"),"")
You can even drag the formula from F3 to the right and all of the rest will auto-fill.
Functions used:
QUERY
I have a data set that looks like this: starting on A1 with "1"
1 a
2 b
3 c
4 d
Column A is an arrayformula =arrayformula(row(b1:b))
Column B is manual input
i want to query the database and finding the row of the item by match column B so i have code as such
=query("A1:B","select A where B like '%c%')
this should give me "3"
My question:
is there a way to pull the 1-4 numbers into the query line? with something like array formula row(b1:b). I don't want to waste an extra column on column A
so basically I want just the manual input and when i query it gives me the row number.
No script code please.
I've tried a few things and it didn't work.
Looking for a solutions that starts with
=query()
You can also use a formula to pull in more than one row in the dataset which matches the condition, if this is important to you:
=arrayformula(filter(row(B:B); B:B="c"))
And you can have wildcard type operators, under certain circumstances (you are going to match text or items that can look like text (so numbers can be treated as text - but boolean will need more steps); that the dataset is not huge), using regular expressions. e.g.
=arrayformula(filter(row(B:B); regexmatch(B:B, "(c|d)")))
You could also use standard spreadsheet wildcard operators, e.g.
=arrayformula(filter(row(B:B); countif(B:B, "*c*")))
Explanation: In this case, the filter will be true when countif is greater than zero, i.e. when it sees something with a letter c in it, since spreadsheets see a value greater than zero as a boolean true and so, for that row where there is a countif match, there will be a a filter match, and so it will display that row (indeed, it is a similar situation with the regexmatch creating a true when there is a match of either c or d, in the case above).
Personally, I wanted to learn regex a bit, so I would go towards the regexmatch option. But that is your choice.
You can also, of course, create the match outside of the cell. This makes it easy to create a list of matches that you want to satisfy elsewhere on the sheet. So you could have a column of words or parts of words, from Z2 downwards, and then join them together in cell Z1 for example like this
="("&join("|",filter(Z2:Z50,len(Z2:Z50)))&")"
Then your filter function would look like this:
=arrayformula(filter(row(B:B), regexmatch(B:B, Z1)))
If you want to use like operator in the query function, you can try something like this:
=arrayformula(query(if({1,0}, B:B,row(B:B)),"select Col2 where Col1 like '%c%' "))
You can also use the regular expressions in the query function, for example:
=arrayformula(query(if({1,0}, B:B,row(B:B)),"select Col2 where Col1 matches '(.*c.*|.*d.*)' "))
I'm not entirely clear on the question, but as I understand it, you want to be able to enter a formula, and have it return the row number of the matched item in a range? I'm not sure where array formulas come in.
If I've understood your question correctly, this should do the trick:
=MATCH("C",B1:B,0)
In your example, this returns 3.
Please forgive me if I've misunderstood your question.
Note: If there are multiple matches, this will return the row number for the first instance of your search.
=QUERY({A1:A,ARRAYFORMULA(ROW(A1:A))},"SELECT Col2 WHERE Col1 LIKE '%c%'")