Excel IF Function, True, False, or Blank - excel

Currently trying to compare two dates to work out whether a document has been submitted within SLA dates
I have 3 cells,
H5 (SLA target date)
T5 (Document submitted date)
U5 (In SLA or Not) Y/N
Using really simple formula in
U5 of =IF(T5-H5 <= 1, "Y", "N")
But the formula is returning true down the column for cells which contain no content yet.
How do I return either a Y, N, or 0 (or blank) in column U?

=IF(OR(ISBLANK(T5),ISBLANK(H5)),0,IF(T5-H5<=1,"Y","N"))
You can change 0 with "" if you want the cell to be blank.

You should add a check for blank cells
=if(or(isblank(T5), isblank(H5)), "blank", IF(T5-H5 <= 1, "Y", "N"))

If both could be empty:
=IF(COUNT(H5,T5)=2,IF(T5-H5<=1,"Y","N"),0)
Or if H column would always be populated:
=IF(T5<>"",IF(T5-H5<=1,"Y","N"),0)

Related

IF Function with multiple statements - If cell contains "0" = "BE", If cell is greater than "0" = "W", If cell is less than "0" = "L"

I'm having trouble trying to get this formula to work.
I have been using this formula =IF(A2="0","BE",IF(A3<=0,"L",IF(A4>=1,"W"))) But it seems something is wrong as it's not returning the correct values.
So basically, If a cell contains "0" I need it to return "BE" - Above "0" I need it to return "W"
& Below "0" I need it to return "L"
https://docs.google.com/spreadsheets/d/1EHbtNmfZ95TgMuSU8sCx8AWKW2zhH3ubXPGu03P1w9g/edit?usp=sharing
I hope this makes sense!
Thank you in advance! :)
Data must be formatted as numbers**
=ArrayFormula(IFS(A2:A11="","",A2:A11=0,"BE",A2:A11>0,"W",A2:A11<0,"L"))
It will A2 in every IF() clause the drag and down the formula. Also for second IF( you can use <=, you have to use only < (less operator). Try below formula.
=IF(A2=0,"BE",IF(A2<0,"L",IF(A2>0,"W","")))
Issue:
IF formula needs 3 parameters, namely the condition, if value, and else value. You lack the else value on the last IF formula so it failed.
Fix:
Basically, we can optimize the formula and only need 2 IF formulas here. Why you may ask? Two nested IF formulas can already cover 3 conditions. We just need to properly order the conditions so 2 IF formulas will suffice.
Explanation:
Since the middle is 0, we need to use it for the first condition. We will first identify if it belongs to which side (negative or positive) so we can minimize the outcome.
I used negative as my first condition. If TRUE, it will return "L", If not, we only have 2 remaining possible conditions left. So we will further check if it is positive. If it is, then return "W", if it isn't negative or positive, then it is automatically 0 and we return "BE".
Formula:
=IF(A2 < 0, "L", IF(A2 > 0, "W", "BE"))
Output:
Optimization:
I do recommend however that you use ARRAYFORMULA so you don't need to copy/drag the formula to every cell. By doing this, you only need to modify the formula of the first row where the data starts. And it will automatically populate the values below.
Formula:
=ARRAYFORMULA(IF(ISBLANK(A2:A), "", IF(A2:A < 0, "L", IF(A2:A > 0, "W", "BE"))))
Output:
Note:
when using ARRAYFORMULA, we just need to additionally check if the data is blank since it will go until the last row available if not added.

How to execute If condition in excel with Null Value [duplicate]

Currently trying to compare two dates to work out whether a document has been submitted within SLA dates
I have 3 cells,
H5 (SLA target date)
T5 (Document submitted date)
U5 (In SLA or Not) Y/N
Using really simple formula in
U5 of =IF(T5-H5 <= 1, "Y", "N")
But the formula is returning true down the column for cells which contain no content yet.
How do I return either a Y, N, or 0 (or blank) in column U?
=IF(OR(ISBLANK(T5),ISBLANK(H5)),0,IF(T5-H5<=1,"Y","N"))
You can change 0 with "" if you want the cell to be blank.
You should add a check for blank cells
=if(or(isblank(T5), isblank(H5)), "blank", IF(T5-H5 <= 1, "Y", "N"))
If both could be empty:
=IF(COUNT(H5,T5)=2,IF(T5-H5<=1,"Y","N"),0)
Or if H column would always be populated:
=IF(T5<>"",IF(T5-H5<=1,"Y","N"),0)

If statement that changes value of another cell than where the function is contained

I have a range of cells that either have a "Y" or "N" in them. I als0 have a "Score" cell that starts with a value of 4. I want to search those cells and if they contain a single "N" then I want the value in cell $S$17 (Score Cell) to be subtracted by 1. If they are all "Y" then I want the number value in $S$17 to remain the same. The formula itself is in cell $S$17 so when I have this formula =IF(COUNTIF(S2:S6,"N"),SUM(S17,-1),S17) it is giving me a circular Reference error. Is there a way to post this formula in a different cell but have the output posted in cell $S$17? I was thinking something like =IF(COUNTIF(S2:S6,"N"),S17 = SUM(S17,-1),S17). I know this isn't correct syntax but thats the idea. Or if thats not possible just avoid the circular reference.
Pretty simple answer here if I understand your Q:
If you want to subtract 1 for EACH "N":
= 4 - COUNTIF(S2:S6, "N")
If you want to ONLY subtract 1 for ANY quantity of "N":
= IF(COUNTIF(S2:S6, "N")>0, 3, 4)

Updating values in cells excel

Please find attached screenshot of my Excel doubt.
As in the screenshot, I want to update the 3rd and 4th row values in the 2nd row, leaving those dates without any value.
In the screenshot it is shown that in the question part 3rd row dates with 5/17/1997 5/18/1997 does not have any values. So want to leave those cell blank and update the rest with the date and values in the 3rd and 4th row, leaving those dates without value for the rest of the cells. Kindly help me with any functions or formulas for doing this.
First step: copy paste Row 3 to Row 10.
Formula in AUE11:
= IFERROR( If(Match(AUE$10, $AUE$4:$AUV$4, 0) > 0, AUE$10, "") , "")
Formula in AUE12:
= If(AUE$11 <> "", Index($AUE$5:$AUV$5, 1, Match(AUE$10, $AUE$4:$AUV$4, 0)), "")
Remember to format Row 10 and 11 as Dates, otherwise you might get numbers as a result (e.g. 35562 instead of 5/12/1997). Also, adjust the range (AUE:AUV) to your actual range.

How do I test the results of an operation for a value?

Techies--
In a nutshell, I have a condition where if I encounter a negative value after operating against other cells, I want to zero out that cell and operate against another set of cells. This formula does not work, but here is what the intent is:
=IF((H3+((D4+D5+D6)*-1)) < 0;M6=0;N6=C4+C5+C6 + (D6)*-1 )
If I add d4-d6 multiplied by -1, this gives me a credit against a debit value I have in H3. Whenever this value exceeds the positive value of the debit in H3, I want zero out the cell (M6) and in the cell next to it (N6), I want to add another set of debits and subtract out the credit I found in D6.
Does anyone know how to do this, or something similar in EXCEL 2010?
In Cell M6 You should have this
=IF((H3+((D4+D5+D6)-1))<0, 0, "")
In Cell N6 You should have this
=IF(NOT(M6 = 0), C4+C5+C6 + (D6)-1, "")

Resources