need a little help with IF & OR to formulate response base on value in Cell M8, I believe i'm very close to what I want but I don't understand the error it.
Ultimately I want the formula to perform the following function
If Cell M8 = No Access, it will display No Access
But if M8 have a value above 61, it'll display "Exceeded Pre-Determined Level",
and if value is between 43 to 61,it'll display "Exceeded Alert Level"
=IF(M8="No Access","No Access", (ABS(M8)>=61,"Exceeded Pre-Determined Level" OR(ABS(M8)>=43,"Exceeded Alert Level")))
Try like this:
=IF(M8="No Access";M8;
IF(M8>=61;"Ex eed Pre-Determined Level";
IF(AND(M8>43;M8<61);"Exceed Alert Level";
"I guess it Is ok")))
You may need to change the ; to ,, depending on your formula separator.
Whenever you write complicated Excel formulas, it is always good to write them on a few lines, using ALT + Enter on the formula bar.
Solution just using another If:
=IF(M8="No Access";"No Access";IF(ABS(M8)>=61;"Exceeded Pre-Determined Level";IF(ABS(M8)>=43;"Exceeded Alert Level";"")))
In this case you don t need an "Or", "Or" would give you the same result for the 2 different logic tests.
I suggest you using absolute references in this case as:
(With note that you have tried absolute numbers)
=IF($M$8="No Access",$M$8,
IF(ABS($M$8)>=61,"Exceeded Pre-Determined Level",
IF(AND(ABS($M$8)>=43,ABS($M$8)<=61), "Exceeded Alert Level",
"None of them")))
And your system separating character may , or ;.
Breaking formula with Alt + Enter
Related
That's basically it.
I have a * in some cells to represent "All" data, because I need it for some formulas later, but I want to use it in the titles so it would be nice if it could display "Total" but still maintain the * below.
As you can see from the picture, the cell should be showing "Total" (red arrow) while mantaining the vale as "*" (blue cirlce).
Tried a few tutorials but nothing seems to work, I'm not sure if it's because it's an asterisk or what.
Edit: the tutorial I mostly followed is this one, in my case instead of 1,2,3,4,etc I have * (aka the value) and I want to display "Total" instead.
Custom number formats in Excel split into four categories:
Positive values
Negative values
Zero values
Text values
* is a text value so you want the fourth category and you get this by inserting semicolons before the required format to indicate that 1, 2 and 3 don't apply so you end up with:
;;;"Total"
where A2 and A4 actually contain an asterisk.
You have cells that have contents X but you want Excel to say, "no, no. I'm going to show you Y"?
Aside from sounding like a maintenance nightmare, I am not aware of a way to do that.
Cells C1,D1,E1's values are "69, 69, Not In Console" <--- This is considered healthy
Cells C2,D2,E1's values are "55, 54, Not In Console" <--- This is Need Attention
Cells C3,D3,E3's values are "54, Not In Console, 55" <--- This is Need Attention
Cells C4,D4,E4's values are "33, Not In Console, 33" <--- This is considered Healthy
The value presented are connections made from 3 different programs in a specific time range. Now if any of these two numbers are different that tells me there is an issue with one of the programs. They should always be the same. The "Not In Console" just says that particular program is not installed which is fine. I need to find the difference between the cells containing numbers while ignoring the cells containing "Not In Console"
Here Is my formula that Tried but its labeling everything as Need Attention
=IF(AND(C2=D2,E2="Not In Console",OR(C2=E2,D2="Not In Console",OR(D2=E2,C2="Not In Console"))),"Healthy","Attention")
Use COUNTIF()
=IF(COUNTIFS(C1:E1,MAX(C1:E1))+COUNTIF(C1:E1,"Not In Console")=3,"Healthy","Not Healthy")
={IF(SUM(EXACT(SUBSTITUTE(C1:E1,"Not in Console",MAX(C1:E1)),MAX(C1:E1))*1)=3,"Healthy", "Not Healthy")}
3 instances of Not in Console are considered Healthy here
If you just use the below formula, you can work with TRUE, FALSE results. You can have your header be HEALTHY?so the output is simple to interpret
={EXACT(SUBSTITUTE(C1:E1,"Not in Console",MAX(C1:E1)),MAX(C1:E1))}
Array formulas must be entered with CTRL + SHIFT
+ ENTER and it should also be stated these are
more invasive, thus, less effecient than other solutions offered here.
Inside a complex Excel2010 formula, is there a way to embed a comment "within a section of the complex formula", so that certain sections (for example, IF-THEN statements) can be commented; allowing on-the-fly analysis of the formula?
I've read this post (How to add comment inside complex excel formula) which covers the basic function of adding comment text to the overall cell with "+N()", but I'm looking for a way to have multiple comments within the formula - similar to REM statements in a DOS batch file, or single-quote comments in VBA code.
Example - my formula (in a basic form):
=IF($C69="","cust is blank",
IF($AL69<>"#",
IF(MONTH($AL69)=$I$5,
"CM","err"),
IFERROR(IF(MONTH($AI69+INDEX('Check Grades'!$A$108:$D$112,MATCH($C69,'Check Grades'!$A$108:$A$112,0),4))=$I$5,
"NM (late)",
"NM (DGI)"
),
"no DGI"
)
)
)
I'd like to input comments for each IF section, if at all possible:
=IF($C69="","cust is blank", *If C69 is blank, then customer not listed*
IF($AL69<>"#", *If AL69 is NOT blank, then check for a valid month*
IF(MONTH($AL69)=$I$5,
"CM","err"),
IFERROR(IF(MONTH($AI69+INDEX('Check Grades'!$A$108:$D$112,MATCH($C69,'Check Grades'!$A$108:$A$112,0),4))=$I$5,
"NM (late)",
"NM (DGI)" *If AI69 plus a lookup value = I5, 'late' else 'on-time'*
),
"other"
)
)
)
...etcetera...
It looks like the +N() function works simply 'after' a formula. Yes, I can (& for the time being, will) split each section into different cells, but in the end, I'll need to combine them. During development of the complex formula, the comments can help me debug, and when all is done, I can paste them all into an external comment; but still, if this multi-comment-in-a-cell is possible, would like to use...
I would recommend spliting the complex formula into multiple parts/cells.
But if that is not an option, you can use the N() function in multiple locations, where the returned "0" value will not make a calculation/logical error.
I admit, I didn't study your formula to understand, if this is the case. I leave that privilege to you.
Here is an example of multiple N() functions not messing things up.
=N("Let me tell you a story,")+(SUM($B$2:$B$3)+N(" about a handful of comments,"))/COUNT($C$2:$C$5)+N(" that went to SO.")
The result is correct = 0+(20+0)/4 + 0 = 5.
Disclaimer: I have never written code in Excel before. I have been building something for work during few days. I have a formula that WORKS! But there is one adjustment that I need to make, that I cannot make happen. Here is what I have. (Again, if its messy, I have no idea, but its currently working).
=IF(AND(D5="Yes LSC, PA's passed")*F5>G5-20,"AT0 Cannot be in same month as W/D",IF(AND(D5="Yes LSC, PA's not passed")*F5>G5-20,"AT0 Cannot be in same month as W/D",IF(AND(E5="Yes, systematic W/D")*F5>G5-20,"AT0 Cannot be in same month as a systematic W/D","")))
Background: I need an excel spreadsheet that we give to new employees as a "cheatsheet" It gives them prompts (I.E "Yes, LSC passed, or Yes, W/D"). They select the prompts and pass to a supervisor for processing.
Goal: I'm trying to write a formula that does not allow simple errors. For my purposes, I know Cell G5 must be AT LEAST 20 greater than F5. So I want an error message to appear every time they try to enter a value that breaks that rule. (Saves management time) And all of that WORKS!
Problem: If G5 is BLANK...It still gives me the message that I've told it to. However, IF G5 is BLANK, I don't need any of the formula to run. I have been trying to build this exception into my amateur formula but I cant get it.
I can understand whats happening.... Excel recognizes that if G5 is blank...then F5>G5-20 is TRUE -- And it gives me text that I want!! But I need an exception... I need it say understand that if G5 is BLANK, then I don't care about F5>G5-20. It can ignore the ENTIRE formula.
Any suggestions? I hope this makes sense.
How would this be?
=IF(ISBLANK(G5),"-", //insert your forumla here// )
an error message to appear every time they try to enter a value that breaks that rule is often handled with Data Validation rather than an IF function. I take it F5 will be completed before G5. Select G5, DATA > Data Tools - Data Validation, Data Validation..., Settings, Allow: Custom, Formula:
=G5>=F5+20
With other settings in their default state this should allow G5 to be blank (or to be populated and then blanked) but give a warning sound and message "The value you entered is not valid." at any attempt to key in an non-compliant value. The warning message may be customised and there is also an option to show an input message where entry of an invalid value is attempted, which might be used to explain the requirement. Alternatively the value might be accepted but later marked as being non-compliant.
It is though rather easy to bypass the validation - just copying from elsewhere and pasting into G5 could do so. Though copying from elsewhere and pasting into the cell with the IF formula would bypass that control too.
Data Validation might also substitute for some of the rest of your IF formula.
I am creating IF statements in Excel to budget according to the discipline of engineers. I want:
IF(H5="CIVIL") then print for me value (I5*5000)
IF(H5="ARCHITECT") then print for me value (I5*3000)
IF(H5="ELECTRIC") then print for me value (I5*3000)
IF(H5="MECHANIC") then print for me value (I5*2000)
I am using a nested IF statement:
=IF(H5="CIVIL",I5,I5*5000,IF(H5="ARCHITECT",I5,I5*3000,IF(H5="ELECTRIC",I5,I5*3000,IF(H5="MECHANIC",I5,I5*2000))))
but I see the message "You've entered too many arguments for this function".
How can I use the formula without any problem?
Please try:
=IF(H5="CIVIL",5000,IF(OR(H5="ARCHITECT",H5="ELECTRIC"),3000,2000))*I5
There will be more professions with more values, so a "single formula" approach is second best. You should use a table with profession and value, and use VLOOKUP, then you can change values and add professions as you like without updating spaghetti formula code ... e.g.
A B
1 Civil 5000
2 Arch 3000
3 Elec 3000
4 Mech 2000
Specifying a profession in H5, you would use the following formula in I5:
=VLOOKUP(H5,A1:B4,2,FALSE)
Looking at your edit ... one more reason NOT to hide the unit cost in a formula, because in 2016 the rates might be different --> use a table!
You can always open your formula in a text editor and check it. I use line breaks to separate arguments. If you don't comment like I did you can even reimplement the now formatted formula. Saved me a lot of times.
Also, I've found your formula's hiatus:
=IF(
H5="CIVIL", 'test
I5, 'If True
I5*5000, 'If False
IF( 'WAT
H5="ARCHITECT",
I5,I5*3000,IF(H5="ELECTRIC",I5,I5*3000,IF(H5="MECHANIC",I5,I5*2000))))