Using ArrayFormula for a running total causes a circular reference - if-statement

See attached Google Sheet for example/sample of my issue. I am trying to use an ARRAYFORMULA() to keep a running total in column C, based on adding the previous row's value in column C with the current row's value in column B. Before I make it an ARRAYFORMULA, it works fine. In column F-H, you can see I tried the array version and get a "circular dependency" error.
The working formula:
=B3+C2 (this is in cell C3)
The non-working formula (with the desired ARRAYFORMULA):
=ArrayFormula(G3:G+H2:H) (this is in cell H3)
My question is, what adjustments can I make to my formula that will allow me to auto-fill this formula down the page as new rows are added (and not populating data for blanks).
Name Days Total Days
Jane 5 6
Tom 2 8
Billy 4 12
Sue 6 18
Sally 1 19
Sample document

=ARRAYFORMULA(IF(B2:B="", ,SUMIF(ROW(B2:B), "<="&ROW(B2:B), B2:B)+1))
demo spreadsheet

if this is what you need ( to always sum total in C column ),
then you don't need arrayformula you can use this simple cell formula (this is C2 formula):
=B2+(If(ISNUMBER(C1), C1, 0))
and spread it down the page, here is the sheet I captured
cheers, kres

Related

Max if statement based on column

I have week no column that came from date, based on the max week no column I am trying to get the if statement yes or no.
Example: if week number column contain from 01 to 40 so 40 is the highest week no so I would like to get the result is Yes by using calculate column otherwise no.
Week No Deired Result
1 No
2 No
3 No
4 No
5 Yed
I got the answer...
IF(MAX(Table [weekno]) =Table [weekno], "Yes", "No".

Return Slicer's Value (trade simulator)

I work with a single table (called sTradeSim) that I have created in PowerQuery. It has 3 columns (Fund1, Fund2, Fund3), each having values from -10 to 10, with an increment of 1.
I also have three separate slicers, each created using an option "Greater than or equal to". Each slicer is having a field assigned to it - Slicer 1 = Fund1, Slicer 2 = Fund2, Slicer 3 = Fund3. Below is a screenshot of Slicer 1.
Right next to these three slicers is a table with three rows. For each row, I would like to retrieve the value of the respective slicers. So the desired result would look like:
Row No 1 = -10.00 (the value of Slicer 1),
Row No 2 = -2.00 (the value of Slicer 2),
Row No 3 = 3.00 (the value of Slicer 3).
Unfortunately, DAX formula that I have developed is always returning 3.00 (the value of the third slicer).
I have tried to find a solution on the forum and combine my SWITCH formula with ALL, ALLEXCEPT, SELECTEDVALUE etc., but it seems like I'm missing something very basic.
mHV_Trades =
SWITCH(
MAX(FundTable[FundsRanked]),
1, MIN(sTradeSim[Fund1]),
2, MIN(sTradeSim[Fund2]),
3, MIN(sTradeSim[Fund3])
)
What you are trying to do doesn't work, because essentially when you place 1 filter on any column on the table, it will filter all the rows that have that value. So, when you apply a filter fund1 = -10 it will also filter the values for fund 2 and fund 3.
You have 2 options:
Create independent tables each with values from -10 to 10
Create a table with all the combinations of -10 to 10 values for every fund.
For your example with 3 funds this works quite nicely (the table has about 10k records), all the combinations of -10 to 10 (21) to the power of 3, the problem with this solution is that depending on the number of funds you have you will run out of space quite quickly.

Get the last 5 results of column C or D if column A or B is equal to ___?

I know the title is a horrible description, sorry.
Basically I have a sheet with results from basketball games. So in column A I have the home team. In column B I have the away team. In column C the home team's points. In column D the away team's points. There's about 500 rows worth of data at the minute.
What I want to do is the following:
Say I want to get the average points scored by the New York Knicks in their last 5 games. The most recent games are at the bottom of the sheet, and the first/oldest ones at the top of the sheet.
So across the bottom/last 5 instances of "New York Knicks" in column A and B, I want the average of the results of C (if New York Knicks is in column A) and D (if in column B).
I know how to do this if I would want just the last 5 home games for instance (so in that instance I basically query the bottom 5 results of column C in the last 5 occurrences of column A being New York Knicks). I don't know how to do it when I am looking for when New York Knicks occurs in either column A or B, and then have to get the averages from column C or D.
Can anyone help?
this will transform your 4 columns into 2 columns:
=ARRAYFORMULA(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
IF(A2:B<>"", "♠"&A2:B&"♦"&C2:D, )),,999^99)),,999^99), "♠")), "♦"))
and average score of the last 5 games:
=ARRAYFORMULA(AVERAGE(QUERY(SPLIT(TRANSPOSE(SPLIT(QUERY(TRANSPOSE(QUERY(TRANSPOSE(
IF(A2:B<>"", "♠"&A2:B&"♦"&C2:D, )),,999^99)),,999^99), "♠")), "♦"),
"select Col2
where lower(Col1) contains 'new york knicks'
offset "&COUNTIF(A2:B, "new york knicks")-5)))

SHarePoint list calculation qualified not weekend

In my SharePoint list, I have a field containing one of three possible values. Depending on the value and a secondary field containing the date submitted, a due date will be calculated (adding 1, 3 or 14 days) to the date submitted but this date cannot land on a weekend and must not count the days as workdays.
I have tried numerous if, and, weekend combinations with no luck. My co-workers are also stumped.
Any assistance is greatly appreciated. Thank you
Assuming a column named "Days" and a column named "TheDate" where "Days" contains the 1, 3, 14 or a formula to select one of those values.
= TheDate+Days + IF(WEEKDAY(TheDate+Days)=1,1,0) + IF(WEEKDAY(TheDate+Days)=7,2,0)
This adds the "Days" to "TheDate" and then:
checks to see if the new date is a Sunday, and if so, adds 1
checks to see if the new date is a Saturday, and if so, adds 2

Reference Cell to the left of last used cell of another column

I am trying to get an excel forumal that will populate that Cell's text referenceing the last used cell in another column.
For example I want the output to be the date of the last used cell in column "B" of ($60.00) to populate the "1/18/13" in a sepereate cell. Does anyone know a formula that will give me the 1/18/13
row# A B C
10 1/12/13 $51.00
11 1/15/13 $15.00
12 1/18/13 $60.00
13 1/31/13 $89.00
14 2/15/13 $43.00
15 2/18/13 $33.00
16 3/15/13 $100.00
Use the onChange event in a macro, or the NOW() function as described in Excel OnChange event