=SUMIF Google Spreadsheet Help needed - google-sheets

I am new to spreadsheets and I need some help.
I created a sheet to register money to be reimbursed.
What I want to do is:
a) The total shows the total amount in Column 'C' but it will subtract the row value only if/when Column 'E' says yes.
b) The total should be on display all time in the merged cells on 'F'.
I was using this:
=SUMIF(E2:E9; "Yes"; B2:B9)
But I think am Way off.
Any kind of help is welcome.
Spreadsheet for reference: Link here

Does this formula work as you want:
=SUMIF(E:E;"No";C:C)

Related

How to return nth value from one Column based on another Column using ArrayFormula or QUERY?

I'm working with a long, growing list of ratings data, and I'm trying to find a way to reference the 2nd (3rd, 4th, etc.) rating.
Here's a link to the sheet I'm working on.
The data I want to reference is in F5:H. I'm using QUERY to show most of the info I want (see A5 in my sheet for this formula), but where I'm running into trouble is when I try to retrieve only the Nth rating from Column H for a particular client based on the Client in Column A.
I'm sure I'm missing something obvious... the biggest (potential) limitation is that I need a formula that I can put in D5 that auto-fills this info for the entire column.
Thanks in advance!
try:
=ARRAYFORMULA(IF(A5:A="",, IFNA(VLOOKUP(A5:A,
FILTER(G5:H, COUNTIFS(G5:G, G5:G, ROW(G5:G), "<="&ROW(G5:G))=2), 2, ),
VLOOKUP(A5:A, G5:H, 2, ))))

Google sheets match index arrayformula

I have a count using a formula that needs to be stretched (the formula is in cell F9
) https://docs.google.com/spreadsheets/d/1sZM1aAuqkHNONJWagiu3aTw6_vfw515gbiKwhKuQAD4/edit#gid=1464536028
=IF(ISBLANK(E9);;IF(O9=TRUE;INDEX('Тех Лист'!$F$2:$M$2;MATCH(TRUE;Q9:X9;0));IF(P9=TRUE;INDEX('Тех Лист'!$F$3:$M$3;MATCH(TRUE;Q9:X9;0));"Ошибка!")))
I tried to remake it under Arrayformula, but nothing came of it ... later I got the idea to do it through query, but when I add query to the array, the data I need disappears
=INDEX(split(FLATTEN(TRANSPOSE({'Стадник'!$D9:D&"x"&'Стадник'!$Q8:$X8&"x"&'Стадник'!Q9:X&"x"&'Тех Лист'!$F$2:$M$2&"x"&'Тех Лист'!$F$3:$M$3}));"x"))
Please tell me how I can compare the headers, and if the list is TRUE, take the sum from the table
In G9 I entered
=ArrayFormula(if(len(E9:E); vlookup(trim(transpose(query(transpose(if(Q9:X; Q8:Y8;));;50000)))&""; transpose('Тех Лист'!E1:M3)&""; if(O9:O; 2; if(P9:P; 3;));0)+0;))
Note that this solution requires that only one checkbox can be ticked in the range X9:X.
See if that helps ?

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.

Is there a function that can create an expanding array formula that conditionally sums a column based on multiple criteria?

To start, this is my first time posting and so please let me know if I can fix my post in any way to make it easier to answer.
I am trying to create an auto-expanding array formula
I have a sheet with my investment asset mix that including amounts of shares owned of each particular stock, and a sheet that tracks when I receive dividends. My goal is to write an automatically expanding array formula that will sum up the amount of shares that own of a stock on the date a dividend is received and return that value. I have written three different formulas that all accomplish this but none of them will auto-expand as an array.
I'm sure there are a lot of solutions I've overlooked. To boil it down, I need an expanding array formula that will sum the "Shares" column of my asset mix sheet ('Asset Mix'!D2:D, or 'AssetMixShares') conditionally. The name of the stock entered in 'Dividends'!C2:C needs to match the name of the stock in 'Asset Mix'!A2:A (or the named range 'AssetMixStocks'). It then needs to check the dates in 'Asset Mix'!C2:C (or 'AssetMixDates') against the dates in 'Dividends'!A2:A and sum all share amounts where the purchase date is less than (earlier than) the Ex-Dividend Date.
I could probably write some sort of vlookup array on the "Running Total" column -- 'Asset Mix'!E:E -- that would solve the issue, but I'm hoping to eliminate that column. I feel very strongly that what I'm trying to do should be possible without the help of a running total column -- I just don't have the knowledge.
I have tried countless functions and formulas, but the four that I currently have in my example worksheet are SUM, SUMPRODUCT, DSUM, and QUERY.
Attempt 1
SUM and IF
=ArrayFormula(SUM(IF('Asset Mix'!A:A=C2,IF('Asset Mix'!C:C<A2,'Asset Mix'!D:D))))
Attempt 2
SUMPRODUCT
=({arrayformula(SUMPRODUCT(--((AssetMixStock=(indirect("C"&ROW())))*(AssetMixDate<(indirect("A"&ROW())))),AssetMixShares))})
Attempt 3
DSUM
=DSUM('Asset Mix'!A:E,"Shares",{"Date","Stock";"<"&A2,C2})
Attempt 4
QUERY
=arrayformula(query(AssetMix,"Select sum(D) where A = '"&C2:C&"' and C < date'"&(text(year(A2:A),"0000") & "-" & text(month(A2:A),"00") & "-" & text(day(A2:A),"00"))&"' label sum(D) ''",0))
These will all work, as long as I manually drag the formula down, but I want to write some sort of formula that will auto-expand to the bottom of the Dividends sheet.
I have tried to create a Dummy sheet that has both of the relevant sheets. Please let me know if you can access it -- the link is below.
https://docs.google.com/spreadsheets/d/1wlKffma0NJ0KrlWxyX_N20y62azsGpFp3enhmjzJK1Q/edit?usp=sharing
Thanks so much for getting this far and any help you can provide!
We can focus in the first formula to understand a way to make it "self-expandable". As we see it contains references to the cells A2 and C2 in "Dividends" sheet:
=ArrayFormula(SUM(IF('Asset Mix'!A:A=C2,IF('Asset Mix'!C:C<A2,'Asset Mix'!D:D))))
Every time some data appears in these columns (A and C), the formula should work. We can control the presence of the formula by onEdit trigger, if editing is manual. Consider the code:
function onEdit(e) {
var sheet = SpreadsheetApp.getActive().getActiveSheet();
if (sheet.getName() == 'Dividends') {
var row = e.range.getRow();
for (var offset = 0; offset < e.range.getHeight(); offset++) {
sheet.getRange(3, 10).copyTo(sheet.getRange(row + offset, 10));
}
}
}
It checks any modification on the sheet "Dividends" and copies required formula to the modified row(s). This way the formula is expanded for other rows in use.
Well, it's solved! I'll leave this up in case anyone else has the same question.
A kind soul explained the magic of MMULT() to me, and wrote this solution.
=ARRAYFORMULA(MMULT((C2:C=TRANSPOSE('Asset Mix'!A2:A))*(A2:A>TRANSPOSE('Asset Mix'!C2:C)),N('Asset Mix'!D2:D))

Any way to highlight current date column in my google spreadsheet?

I have this planning sheet I am working on: https://docs.google.com/spreadsheets/d/1GQpZh0MOotBl_iAucGm_LnK8shIKjjgukGqaFVvGKF8/edit?usp=sharing
As you can see events are planned out on a sort of calendar look.
I will be using this every day and I would like it to highlight the current date to me automatically. I've highlighted today's date manually.
Do you see any way to do this?
It does not need to be the whole column it can just be the day number and week of day on the top if it's easier.
I would greatly appreciate any help you can give me regarding this!
Thanks a lot.
Balint
I found this question when searching for a way to highlight a whole column/row.
Here's the way to do it:
Apply to range: A1:Z1000 (this is the range of all columns/rows including the dates)
Format cells if...: [Custom formula is]
Formula (for columns): =A$1=TODAY()
Formula (for rows): =$A1=TODAY()
The dollar sign ($) will keep the reference cell fixed. So if the formula uses A$1 it takes A1, B1, C1 etc to look for the date and then highlights the entire column A, B, C etc.
If the formula uses $A1 it takes A1, A2, A3 etc to look for the date and then highlights the entire row 1, 2, 3 etc.
Just make sure that "range" covers the entire rectangle of cells and not just one date. It's easy to adapt if your dates are in a different row/column.
Hope this helps the next person who comes here with a similar problem :)
You would have to use conditional formatting
on the column with the dates. Rule should be "Date is today". Choose a color to your likings.

Resources