My formula is the following one, I want the cell green if cell value is not "" and it's greater than today.
=AND(F1<>"";F1>=TODAY())
The thing is it applies to the whole column =$F:$F, and I have a header with text, which is filled with green.
I know I can execute the formula beginning at the first date value, but is there any way to exclude text values to this formula, or maybe some IFNUMBER, if exist?
check ISNUMBER and combine it with your formula.
Or use and extra condition, something like =AND(F1<>"";F1>=TODAY();ROW(F1)<>1)
Exclude row 1 (if row 1 is the header row, ofc)
=AND(ISNUMBER(F1);F1>=TODAY())
Related
How to write a formula in excel that based on critria it can check if list of multiple result cells have same value.
I attached example:
Look for all cell with the number 100
Verify that the list of these cells contain same date value of one cell.
I try to use formula such as: COUNTIF + INDEX and MATCH but didn't work as expacted.
I'm guessing you can use =ROWS(FILTER(....)) but what I would do is create a hidden column that evaluates it per row, maybe with something like
=IF(A2="","",XLOOKUP(A2,A$2:A,B$2:B)=B2)
and copy that formula down the column.
This way, you can not only see if there are any bad values (by COUNTIFS for false values where the A-column's value matches the "find these cells" value) but apply conditional formatting as well to highlight the bad values.
I'm trying to have one column change color (individual cells in that column, rather) depending on if there is text in a different cell in the same row. I've tried using something along the lines of =IF(($B1<>""), TRUE, FALSE) and that works, but when I try to copy that formatting to the rest of the column, the cell number that the formula references stays the same, so every cell in column A will reference cell B1 instead of changing the reference cell to B2, B3, etc... on down the column.
The problem with your formula i'm assuming is the $ sign which is an absolute reference. So if you use $B1 in your formula, you're saying that you need to always compare against the value in column B.
using this formula should probably work for you:
=IF(B1<>"", TRUE, FALSE)
But it also depends on the range that you're applying this conditional-format on.
TIP:
You don't even have to use the IF function, B1<>"" returns TRUE or FASLE by default.
I have a list of students who are between the ages of 3 and 5. lets say column A has the code, Column D has the childs age & Column F has their age group (3-5) If their age exceeds the age group then the Cell in column A will highlight Red. I am just not sure how to write this code correctly, all of the combinations i have tried come up with an error or just don't do anything.
IF(OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,7)="3-5" & (OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,4)>5 {THEN FILL CELL RED} {ELSE NO FILL}
In the first part of the statement you are checking whether the cell 7 columns across = "3-5". You don't need to use offset for this, you can just reference the cell 7 across directly.
So if you're applying the conditional formatting to A1 that part of the formula would just be =IF(H1="3-5",{then},{else}).
If you just want TRUE or FALSE as the answer you don't need the IF statement, so this shortens to: =H1="3-5",
If you're applying the conditional formatting to a range instead of just an individual cell, say A1:B10, then you write the formula for the cell in the top left of the that range. So for A1:B10 you would still you the same formulae as above.
For the second part of the statement, using the same logic as above, you get: =E1>5
To check both statements together you need to wrap them in the =AND() function, giving you this as the final formula for your conditional formatting:
=AND(H1="3-5",E1>5)
By using the AND function I can achieve the desired result without cell references moving if a cell is relocated.
=AND(OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,7)="3-5yo",OFFSET(INDIRECT(ADDRESS(ROW(),COLUMN())),0,4)>5)
I have an if statement working properly in only one cell. =IF(B28="Others",+C28, 0). However, I also want to include the cells B28 to B30 and will add C28 to C30 respectively in the formula. How will I be able to do so? I have tried this formula: =IF(B28:B30="Others",+C28:C30, 0) but it won't work.
What I want to happen is this:
I will input values in the cells C28:C30, and if they're under a certain category (ex. B28 says 'Others'), that value will be added to that category above (ex. C18 for 'Others').
If it works, C18 should have a value of 1,450 since 1,150 and 300 are both under 'Others'.
The function you're looking for is SUMIF(). You can read about it here.
The complete formula you need is: =SUMIF(B28:B30,"Others",C28:C30)
you might want to use a sumif statement where you're summing on the values in C based on the category in B
http://www.exceltrick.com/formulas_macros/excel-sumif-and-sumifs/
I've searched for an answer for this for awhile now but haven't had any luck. It's a bit difficult to put into words, so please let me know if anything's unclear.
What I want is a way to perform conditional statements on two columns. When both conditions are true, I want to return the value from a third column that is in the same row as where these conditions were met. So if the conditions are true in D5 and C5, I want to return the value from Q5 into the cell with the formula. The conditional statements are easy enough but I haven't figured out the last step yet.
If I use the following formula, I get 1 in the cell with the formula, which is right.
=IF(AND('Stata Output'!D2:D6='Backcheck schedule and results'!C2, 'Stata Output'!C2:C6=1),1,0)
However, replacing 1 in the formula with the range of cells that I want to pull the value from gives me a zero every time, which I know is wrong. For this latter formula I'm using:
=IF(AND('Stata Output'!D2:D6='Backcheck schedule and results'!C2, 'Stata Output'!C2:C6=1),'Stata Output'!Q2:Q5,0)
Any ideas on where I'm messing up?
Thanks!
Give this a shot - I'm sure there is a simpler way but it seems to get the job done (make sure to enter as an array formula with Control+Shift+Enter):
=INDEX('Stata Output'!$D$2:$Q$6,MATCH(1,(--('Stata Output'!$C$2:$C$6=1)*--('Stata Output'!$D$2:$D$6="Backcheck schedule and results")),0),14)
What this does is take your entire table as the range (first argument to INDEX, then uses MATCH to find the row where both of your conditions are met (in this case, column C must be 1 and the corresponding value in column D must be Backcheck schedule and results). You then search the resulting array for 1 (which indicates the match) and return column 14 (which represents column Q in our table). You can continue to add filters inside the MATCH() function as needed.
Note that this will match only the first 'hit'.
Looks like AND isn't working correctly in array formulas, so I would use this:
=IF(('Stata Output'!D2:D6='Backcheck schedule and results'!C2)*('Stata Output'!C2:C6=1)=1,'Stata Output'!Q2:Q5,0)
This will give you a new results column, that will be filled from the Q2:Q6 column for every matching row.
To use it, you should select all of the results column, input the formula and then use CTRL+SHIFT+ENTER.
Just make sure to use use ranges of the same size.
Try the following formula:
=LOOKUP(2,1/('Stata Output'!D2:D6='Backcheck schedule and results'!C2)/('Stata Output'!C2:C6=1),'Stata Output'!Q2:Q5)
If there is more than one row where both conditions are satisfied, this formula will return the col Q value from the last of those.