Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-04-2014, 07:00 AM
mbesspiata mbesspiata is offline If statement question Windows 7 64bit If statement question Office 2010 64bit
Advanced Beginner
If statement question
 
Join Date: Mar 2011
Location: Virginia
Posts: 57
mbesspiata is on a distinguished road
Default If statement question

I have an if statement for a column of rank numbers which will show the text "LOW" when the rank is 1. Is there a way to state an if statement (and add to the current statement) to have it show the text "HIGH" when the largest rank number is listed (instead of referring to a specific number)?
Hope that made sense.

Mike
Reply With Quote
  #2  
Old 06-04-2014, 07:38 AM
BobBridges's Avatar
BobBridges BobBridges is offline If statement question Windows 7 64bit If statement question Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Yeah, I think so, if I understand the question. Let's say the ranks are in column E. Then for any rank=1 you use =IF(En=1,"Low","Something else"), and for rank=<highest> you use =IF(En=MAX(E:E),"High","Something else"). How's that?
Reply With Quote
  #3  
Old 06-04-2014, 07:44 AM
mbesspiata mbesspiata is offline If statement question Windows 7 64bit If statement question Office 2010 64bit
Advanced Beginner
If statement question
 
Join Date: Mar 2011
Location: Virginia
Posts: 57
mbesspiata is on a distinguished road
Default

OK. Sounds great. Just two questions. What is "En" and do I use the text "Something else" or am I supposed to supply something there?
Reply With Quote
  #4  
Old 06-04-2014, 08:04 AM
BobBridges's Avatar
BobBridges BobBridges is offline If statement question Windows 7 64bit If statement question Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

"En" is what I used for "E"-plus-row-number, whatever row you happen to be on. (I use R1C1 notation, myself, which would be ideal for this sort of thing if anyone else used it too.) So on row 2 the formula would be
Code:
=IF(E2=MAX(E:E),"High","Something else")
...or in R1C1 it would look like this:
Code:
=IF(RC5=MAX(C5),"High","Something else")
As for the "Something Else", you have to specify what you want it to display if it's not "Low" or "High". I was being more or less jocular with "Something else"; probably you'll use just a blank string, "".
Reply With Quote
  #5  
Old 06-04-2014, 08:15 AM
mbesspiata mbesspiata is offline If statement question Windows 7 64bit If statement question Office 2010 64bit
Advanced Beginner
If statement question
 
Join Date: Mar 2011
Location: Virginia
Posts: 57
mbesspiata is on a distinguished road
Default

OK thanks. Now can I put both of those statements in one cell and if so, how do I combine (stack) them?
Reply With Quote
  #6  
Old 06-04-2014, 08:24 AM
BobBridges's Avatar
BobBridges BobBridges is offline If statement question Windows 7 64bit If statement question Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Sorry, I tried to clarify and only confused the issue. If you use A1 notation (most people do), you use the first formula. If you use R1C1, as I do, you use the second. They're the same statement, just expressed in different ways.

The fact that you didn't notice that the second statement was actually the first (in a different notation) tells me you almost certainly use A1, which after all is what Excel ships in. In that notation you use letters for columns and numbers for rows.

Does that help, or did I just make it worse?
Reply With Quote
  #7  
Old 06-04-2014, 09:23 AM
mbesspiata mbesspiata is offline If statement question Windows 7 64bit If statement question Office 2010 64bit
Advanced Beginner
If statement question
 
Join Date: Mar 2011
Location: Virginia
Posts: 57
mbesspiata is on a distinguished road
Default

OK. I think I might not be expressing what I need. I am clear on the the cell reference designation. I want to put both the if statements in one cell. Here is what I have so far (that doesn't work).
=IF(E3=1,"LOW")+IF(E3=MAX(E:E),"HIGH")
Reply With Quote
  #8  
Old 06-04-2014, 10:09 AM
mbesspiata mbesspiata is offline If statement question Windows 7 64bit If statement question Office 2010 64bit
Advanced Beginner
If statement question
 
Join Date: Mar 2011
Location: Virginia
Posts: 57
mbesspiata is on a distinguished road
Default

I just tried this formula and it works to show me the LOW but the HIGH is not working.
=IF(E3=1,"LOW",IF(E3=MAX(E:E),"HIGH")). For all rows excet the LOW it get the #N/A.
Mike
Reply With Quote
  #9  
Old 06-04-2014, 12:29 PM
BobBridges's Avatar
BobBridges BobBridges is offline If statement question Windows 7 64bit If statement question Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Oh, duh, I see what you mean. (Sorry, I'm slow today.) You still have to say what you want it to display when it's not the max value. Hm, when I use your formula I get not #VALUE# but FALSE for all the values that aren't Low. What version of Excel are you using?

Regardless of the version, though, you're missing a final argument. The IF function requires three:

1) The condition being tested, in this case E3=1 or E3=MAX(E:E)
2) The value to be used if the condition is true (eg "LOW")
3) The value to be used if the condition is false.

Now, you have two IF functions here. The first one has all three arguments:
Code:
=IF(E3=1,"LOW",IF(...))
The condition is E3=1, the "true" value is "LOW" and the "false" value is another IF function. So if E3=1 it displays "LOW"; if it isn't 1, if it's anything else, it displays whatever is the result of the embedded IF function.

The second IF function, however, is incomplete; it has only two arguments:
Code:
IF(E3=MAX(E:E),"HIGH")
The condition is E3=MAX(E:E), and the "true" value is "HIGH". But you never told it what to display if it isn't the max value. You have to tell it something, like this:
Code:
=IF(E3=1,"LOW",IF(E3=MAX(E:E),"HIGH","SOMETHING ELSE"))
What do you want Excel to display there if it's not a high or low value?
Reply With Quote
  #10  
Old 06-04-2014, 12:37 PM
mbesspiata mbesspiata is offline If statement question Windows 7 64bit If statement question Office 2010 64bit
Advanced Beginner
If statement question
 
Join Date: Mar 2011
Location: Virginia
Posts: 57
mbesspiata is on a distinguished road
Default

Bingo. thank you very much for the answer and your patience.

Mike
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add a statement sma Word 6 03-23-2014 10:30 AM
Question about Case statement Jennifer Murphy Word VBA 1 01-05-2013 02:30 PM
If statement question Help with IF Statement limpbizkit Excel 4 02-24-2011 09:16 PM
If statement question if statement piper7971 PowerPoint 1 08-19-2010 07:10 AM
If statement question Help with IF statement! CPelkey Word 1 04-12-2010 09:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:15 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft