I have a formula in Google Sheets that counts the number of times a phrase has occurred in another column up to and including the row.
="BMC - Thursdays"&":"&COUNTIF($C$1:C1,"*BMC - Thursdays*")
This formula is in A1, and when I drag this down, it automatically adjusts it so that in A2, it searches cells C1 and C2, in A3 it counts occurrences in C1, C2, and C3, etc.
Unfortunately, all of my new data is imported from paperform, which creates a new row each time. I would love it to automatically run that formula on the new row. I have tried doing this several ways using an arrayformula, but I've been unsuccessful, I just don't know enough to come close. It work perfectly when I drag the formula down from already existing columns, so have no idea why there isn't an easy way to do this (that I've been able to find yet).
Any help is much appreciated. Thanks!
An example sheet of what I'm looking for can be found here:BMC Tally Sheet
See if this works
=ARRAYFORMULA(IF(LEN(C:C), "BMC - Thursdays"&":"&COUNTIFS(C:C, "*BMC - Thursdays*", ROW(C:C), "<="&ROW(C:C)),))
Related
Edit: I initially diagnosed this problem totally wrong, so the question is entirely rewritten to reflect new understanding.
The problem can be reproduced using a Google spreadsheet with one sheet that contains one header row and a significant number of additional rows (let’s say 5,000).
I wanted column A to increment by 1, starting with A2, as long as the adjacent cell in B was not blank. I used this formula in A1:
={"SKU"; arrayformula(if($B2:$B="","",text(row($A2:$A),"000000")))}
This formula worked but caused extremely significant lag.
In one of my attempts to resolve the issue, I added a helper column before column A and split my formula into two formulas to see which function was causing the lag:
Cell A1: ={"SKU (helper)"; arrayformula(if($C2:$C="","",row($A2:$A)))}
Cell B1: ={"SKU"; arrayformula(if($C2:$C="","",text($A2:$A,"000000")))}
To my surprise, the answer was neither. The lag was completely eliminated. What is the reason? And is it possible to eliminate the lag without the need for a helper column?
use:
={"SKU"; SEQUENCE(ROWS(A:A)-5344; 1; 5344)}
update:
={"SKU"; INDEX(TEXT(SEQUENCE(COUNTA(B2:B)), "000000"))}
if you have empty cells in between use:
=LAMBDA(x, {"SKU"; INDEX(IF(x="",,
TEXT(COUNTIFS(x, "<>", ROW(x), "<="&ROW(x)), "000000")))})
(B2:INDEX(B:B, MAX((B:B<>"")*ROW(B:B))))
This may simply be a convoluted duplicate of an existing question, and I have been able to find one or two issues that match what I'm seeing here, but I am very curious to see if the cause is just user error on my part or if this is something I am just not aware of.
I have a worksheet titled Sheet1 with 999 rows. On this sheet in cells A3, B3, and C3 down are Year values (2021), Month numbers (1, 2, 3, etc.), and Quarter (Q1, Q2, etc.). In cell D, I have the following long but simple formula:
=SUMPRODUCT((MONTH(INDIRECT("TestSheet ("&C2&" "&A2&")!$C$3:$C$999"))=B2)*(YEAR(INDIRECT("TestSheet ("&C2&" "&A2&")!$C$3:$C$999"))=A2)*(INDIRECT("TestSheet ("&C2&" "&A2&")!$E$3:$E$999")))
What this formula does is sum the monetary values from sheets with variable names by month (INDIRECT is used to refer to sheets with the name "TestSheet (x y)", where x is the Quarter value and y is the year (ie: "TestSheet (Q1 2021)").
This formula functions as intended, and correctly sums the values on the variable sheet names when those sheets exist. The issue I'm running into is that it seems to take a length of time for Sheets to identify that a sheet exists, even when "On change and every minute" is selected under the Calculation tab under Spreadsheet Settings. From testing on a fresh workbook in which this formula is the only one present and there are no other formulas present that could be slowing down the recalculation, the cell values do not appear to update at all even an hour after the relevant cells have been updated with data.
Is there any indication based on what I have so far that stands out as a possible cause? Any suggestions would be appreciated.
try:
=INDEX(SUMIF(TEXT(
INDIRECT("TestSheet ("&C5&" "&A5&")!C2:C"), "yyyyM"), A5&B5,
INDIRECT("TestSheet ("&C5&" "&A5&")!E2:E")))
I am trying to SUM all rows based on the condition that a row's value is greater than 0. However, the formula is only calculating the first row and ignoring the rest of the range. I encountered this issue on a different spreadsheet but I isolated the issue on a new spreadsheet to show you and ask questions.
The answers should be B1 ($5), B2 ($15), B3 ($30).
I followed the formula's usage as explained in the Google Docs https://support.google.com/docs/answer/3093583?hl=en
The formula with respective row number =SUMIF(A1, ">0", A$1:A1)
Update - The below is my intended purpose. I have a spreadsheet that calculates money In and Out. For each of these transactions, I simply want the balance as a result of such transactions. This only works for the first row. (I hardcoded the values for the rest of the rows just to show my goal.)
try:
=ARRAYFORMULA(IF(A:A="",,SUMIF(ROW(A:A), "<="&ROW(A:A), A:A)))
if you prefer dragging do:
=SUMIF(INDIRECT("A1:A"&ROW()), ">0")
UPDATE:
=ARRAYFORMULA(IF(D2:D="",,
SUMIF(ROW(D2:D), "<="&ROW(D2:D), D2:D)-
SUMIF(ROW(E2:E), "<="&ROW(E2:E), E2:E)))
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))
Let me start by saying this, I have very minimal Excel knowledge. If my question seems not proper for stack overflow, please guide me where else to look (or which terms to use to google).
I have two sheets. I want to access Sheet B and through columns A1:A32 per se. If Cell A1 contains 'yes', then I want to paste A1, B1, C1, D1 into Sheet A. So basically, if 16 cells out of the 32 in column A of Sheet B have 'yes', then there will be 16 records in Sheet A.
I don't know where to even begin to do this. I've googled a bit and stumbled across VLookup, but not 100% sure how to apply it.
EDIT:
Sheet A - Empty
Sheet B -
Columns: istrue,Name,X,Y
Do either of these two formulae work as you want:
=FILTER(Sheet2!A:D,Sheet2!A:A="yes")
=QUERY(Sheet2!A:D,"where A = 'yes'") (note that the 'yes' is case-sensitive)