Conditional formula in Google Spreadsheet - google-sheets

I'm trying to set up the following formula:
I have an Overview sheet where I want to sum the fields in Column B in Sheet named "Accounting", BUT, only sum the Expenses where Column D of the same row in Sheet Accounting is "Expenses"
I've tried a few different formulas, and none worked. Here's the latest one I tried
=search("Expense",(Accounting!B:B)) SUM(Accounting!B:B)
Can anyone help me?
Thanks!

=SUMIF(Accounting!D:D,"Expenses",Accounting!B:B)

Related

On Google Sheets, copy the contents of a column to another column but skip some destination cells

On a Google sheets, column A has checkboxes, column C is a list of items.
Copy all the items from column C to column B but skip the destination cells that are on the same row as a checked box from column A.
No cells from column C should be skipped.
Here's the sheet with the desired result in column B:
https://docs.google.com/spreadsheets/d/1DAncxmuTEuk2zuW_h8xC3SNBqOnJ7r-JaJ5gbZkpltU/edit?usp=sharing
I'm struggling to create a formula to do that.
Thank you! :)
I can't come up with a formula to do that. I've been Googling it but no luck. Any hep would be much appreciated. Thank you.
can you try this:
=QUERY(ARRAYFORMULA(SORT({BYROW(A:A,LAMBDA(ladr,IF(ladr=TRUE,{IFERROR(1/0),ROW(ladr)-(COUNTIF(A$1:OFFSET(ladr,-1,0),TRUE))},)));{C:C,row(C:C)}},2,1)),"Select Col1 Where Col2 is not null")
-
Another approach (tick boxes in A1:A, source list in B1:Bn):
=arrayformula(ifna(vlookup(query(reduce(,A1:index(A:A,counta(B:B)+countif(A:A,true)),lambda(a,r,{a;if(r=true,,max(a)+1)})),"offset 1",0),{row(B:B),B:B},2,0)))

Copy a NB.SI formula into a Google Sheets sheet

I am turning to you today for help with a problem on Google Sheets.
I receive this data from a Google Sheets form: An answer (0 or 1) to 5 different questions.
I would like to calculate in column A (in green) the scores out of 5 for each row, as soon as a new row is added by the form.
I tried to use the ARRAYFORMULA() function but it does the count for all the cells in the range and not just row by row:
Do you have an idea to have a score out of 5 for each line of question and have it apply to the whole file as soon as a new line is added by the Google Form?
Thanks for your help
If you want to use COUNTIF (English correspondance for NB.SI), modify your formula to:
=ARRAYFORMULA(COUNTIF(IF(B1:F=1,ROW(B1:B)), ROW(B1:B)))
or for your regional settings:
=ARRAYFORMULA(NB.SI(IF(B1:F=1,ROW(B1:B)), ROW(B1:B)))
You can get a row-by-row sum with sumif() like this in cell A3:
=arrayformula( sumif( if(column(B3:F), row(B3:F)), row(B3:F), B3:F) )
This formula uses open-ended range references so it will create results all the way down to the end of the sheet. To limit that, use a range reference like B3:F100 instead.

Google tabs IMPORTRANGE with SUMIF problems

I know it has already been a few times discussed topic, but I haven't found any help that would suit my problem yet.
I'm trying to make a sum of numbers in one column in a different Google sheet. The problem is I need to sum only those numbers happened in chosen month. I have the number of the month in the sheet where I need the function, and I have the month specifikation in a column next to the numbers.
All I came to till now is this (after many totally different codes):
=sum(query(IMPORTRANGE("xyz";"Výkaz!B23:C125");"select Col2,Col3 where "col2=G4";0)"))
G4 is the chosen month I have in the same sheet as this code
Please, could you help me figure this out? Thank you
Google Sheet 1 (TabName = "externalTab")
Google Sheet 2 (TabName = "InternalTab")
Use importrange to pull the all data from "externalTab" to "Internal Tab". Then just use a sumifs formula to add up values based on your criteria.
=IMPORTRANGE("https://docs.google.com/spreadsheets/d/1sLPGZkAVlxWfjhDMU9oa_cww0AI570Rtem0XCoOx0AE", "'externalTab '!A1:AF2000")
Alternatively use the following formula. Integers to be summed are located in column a/Col1 and Months are located in column b/Col2. There is one header row on the spreadsheet and we are adding up all the Integers that correspond to the month June.
=sum(query(importrange("https://docs.google.com/spreadsheets/d/1sLPGZkAVlxWfjhDMU9oa_cww0AI570Rtem0XCoOx0AE","a1:b1000"),"select Col1, Col2 WHERE Col2 = 'June'",1))

Preserving formula of a column when adding new rows in Google Sheets

I have a sheet which looks like this:
The C column is simply the product of column A and B. This formula is replicated in the entirely of column C, from row 2 to 1000.
However, if I add a new row between two existing rows, the formula is no longer there for that specific row. Looking around for solutions, I came across ArrayFormula. I changed my formula to the following:
=ARRAYFORMULA(IF(OR(A2="",B2=""),"",PRODUCT(A2:A, B2:B)))
However, this messed up the result. How can I solve this problem?
ARRAYFORMULA does not understand OR so you need to convert it into 0/1 logic:
=ARRAYFORMULA(IF(((A2:A="")+(B2:B="")), , A2:A*B2:B))

Formula to search for a matching item on two Google sheets and then fill in a third value if a match is found

I have two google sheets.
-Sales Sheet
-Goal sheet
On the sales sheet:
Column I has a list of items
Column J is blank
On the goal sheet:
Column A has a list of items
Column I has a list of values.
I need a formula to enter on the Sales sheet, which will search for the item listed in column I for a matching item on column A of the goal sheet.
When a match is found, it needs to take the value found in column I of the goal sheet and place it into column J of the sales sheet.
I've tried several formulas using MATCH but I just can't seem to get it to work. Any help would be sincerely and greatly appreciated!!
I tired this formula, but it seems to be filling in the value from column A instead of the corresponding value from column I. I know I'm missing a step here, but I don't know where to start:
=INDEX(IMPORTRANGE("[Sheet ID]","Page!I1:I500"),MATCH(A121,A1:A500,0))
I figured it out:
=INDEX(IMPORTRANGE("[sheet ID]","Goal-sheet!$I$2:$I$500"),MATCH(I5,IMPORTRANGE("[sheet ID]","Goal-Guide-Internal!$A$2:$A$500"),0))

Resources