Google Sheets: Conditional Formatting - Individual Rows - if-statement

This question was posted 4/1/21 (d/m/yy).
In Google Sheets, I have a table of all my tests, like below:
Subject
Test
Date (d/m/yy)
C3 - Biology
1
1/1/21
C4 - Chemistry
2
3/1/21
C5 - Music
3
4/1/21
C6 - Physics
4
6/1/21
In Column D, I have the formula =TODAY(), which gets today's current date.
In Column E, I have the formula =IFS(C3=D3,"Today",C3<D3,"Past",C3>D3,"Future"), which prints "Today" if the test is today, "Past" if it has passed, and "Future" if it is yet to happen.
In each row, the C3 and D3 values change to the row number.
I have these conditional formatting rules in C3:
=E3="Today" RANGE: C3
=E3="Past" RANGE: C3
=E3="Future" RANGE: C3
However, when I "drag" this cell to copy conditional formatting rules to C4, this happens:
=E3="Today" RANGE: C3:C4
=E3="Past" RANGE: C3:C4
=E3="Future" RANGE: C3:C4
I have tried putting these in the column of C, but it comes up as an error:
=E$="Today"
=E$="Past"
=E$="Future"
TL DR: How can I create conditional formatting for a row that changes according to its' row number?

use:
=E3="Today"
on range C3:C
if you want to paint the whole row use:
=$E3="Today"
on range A3:C

Related

PowerBi Conditional Column Between 2 Dates

My First PowerBi Question on here.
Im trying to insert a Conditional Column in the Power Query Editor where if a date falls between Certain dates, a specific Value is added. The dates and values are listed below.
I have attached a screenshot of my attempt but the results stop at 51 and do no increase from there.
can you please confirm where i am going wrong with this? its almost as if it needs a Between arguement but not sure if this is possible in the Power Query Editor?
Dates & Values:
Before 18/07/2022 = 31
On or After 18/07/2022 & Before 08/08/2022 = 51
On or After 08/08/2022 & Before 30/08/2022 = 71
On or After 30/08/2022 = 91
If statement searchs for the first TRUE() value and return it. In your case you use condition "after or equal" so every date with value >=18/07/2022 gets 51, because it is the first True value.
Try to change the order:
is before 18/07/2022 = 31
after or equal to 30/08/2022 = 91
after or equal to 08/08/2022 = 71
after or equal to 18/07/2022 = 51

Fill down formula

Is there a way of fill a formula down to the last row dynamically as new lines are added without a script just in the formula in google sheets I need the formula only in the cells with data and not in empty cells so if I have in column B1/B5 1,2,3,4,5 I want in column A1 =B1 and to fill down to row A5 =B5, and only in the first 5 rows and to automatically add the formula in A6 when B6 is filled.
sure, try this in A1 cell:
=ARRAYFORMULA(IF(B1:B<>""; ROW(A1:A); ))
or put there whatever you want:
=ARRAYFORMULA(IF(B1:B<>""; B1:B; ))

Can I make the values of an IF function into equations?

I'm working on a simple budget sheet in Google Sheets, and want to know if I can make the values of an IF function into an equation.
Column A describes the activity (as in, purchased DVD, received paycheck, etc).
Column B lists the amount of the activity if it was income; otherwise, it remains blank.
Column C lists the amount if the activity was an expense; otherwise, it remains blank.
Column D is my total amount, which takes the total amount in the cell directly above it and either adds to that value with the value in column B, or subtracts from that value with the value in column C. I have to personally input that equation, which is pretty time-consuming.
I was hoping to use column E to be a row that I mark as "Y" if that row was income. Otherwise, I would leave it blank.
Then I wanted to replace the equation in column D with an IF statement that checks if column E has a "Y" in it. If it does, then it performs the addition equation using columns D and B. (And if E is blank, then the equation simply has column C subtracted from column D.)
Say I have the following table:
1. Col. A || Col. B || Col. C || Col D.
1. Event || Income || Expense || Total
1. START VAL.||--------||---------|| $100.00 ||
2. Hamburger ||--------|| $10 || =D3-C4 ||
3. Paycheck || $20 ||---------|| =D4+B5 ||
Instead, I'm hoping to add column E so the table looks like this:
1. --Col. A---||-Col. B-||--Col. C-||----Col D.----||-Col. E----||
2. --Event----||Income--||-Expense-||----Total-----||-Is Income?||
3. STARTVAL. ||--------||---------||-----$100-----||-----------||
4. Hamburger ||--------|| $10 ||--*FORMULA 1*-||-----------||
5. Paycheck ||--$20---||---------||--*FORMULA 2*-||-----Y-----||
I thought that the FORMULA 1 would have to look like this:
=IF(E4="Y",(D3+B4),(D3-C4))
Formula 2 would look like this:
=IF(E5="Y",(D4+B5),(D4-C5))
You can see that having to update each cell by 1 depending on if it's income or an expense is inefficient...
I would expect column E to cause the IF function in column D to produce new equations depending on the value in column E, but all I get in Google Sheets is
Formula Parse error
try this formula in D4 cell and drag down:
=IF(E4="Y"; D3+B4; D3-C4)
if that works delete everything in range D4:D and paste this in D4 cell:
=ARRAYFORMULA(IF(LEN(A4:A); IF(E4:E="Y"; D3:D+B4:B; D3:D-C4:C); ))

Weeknum function is not working correctly

I got an issue using DAX function. The thing is that I'm using a dataset and I need to caclulate the date using weeks but unfortunately I can't find it directly.
So, I have created a new measure and I tried to apply the function below :
Week Number = WEEKNUM(Table1[Date],2)
And this give me the following error :
"A single value for column 'Date' in table 'Table1' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."
The structure of my file is like this:
DATE N° PAGE
26/06/2018 E2 17
27/06/2018 E6 59
28/06/2018 E7 179
29/06/2018 E8 223
30/06/2018 E11 205
01/07/2018 F13 202
What am I missing ?
Thanks in advance.
I don't think this is a problem having to do with the WEEKNUM function, but has to do with the difference between a measure and a calculated column.
If you are creating a calculated column then your formula should work because DAX uses the row context to know which single date to use in the calculation.
If you are creating a measure then it is not associated with any single row, so you need to specify an aggregate so it has a single date value to work with.
Reference: Calculated columns and measures in DAX

Using ArrayFormula for a running total causes a circular reference

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