Solved

Determining If a Value Is Outside of a Given Range and Flag a Cell If True in Excel 2010

Posted on 2013-12-13
9
250 Views
Last Modified: 2013-12-23
Hello,
I have a user who wants to have value compared two values that determine a range.  If the value is greater than or less than the range between the two other values.  He would like to flag an entirely different cell than the one containing the formula.

Here is a clearer example of the logic:

Logic hoping to achieve
If (O4) is less than (E4) OR (O4) is greater than (F4) then (O63),“R”

Incorrect Excel function
=IF (O4) < (E4) OR > (F4),(O63,”R”)
0
Comment
Question by:tmaususer
9 Comments
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39717186
Hi,

May I suggest this?

=IF(OR(O4<E4,O4>F4),O63,"R")

BFN,

fp.
0
 

Author Comment

by:tmaususer
ID: 39717506
I like this.  I think it is very close.  I tried it and discovered I may have not explained my situation well.  I have attached a picture to help.  

For example, they want to enter a value in cell O49 (red number) and if it is out side the range between cells E49 and F49 (both yellow), then they want cell O63 (circled in blue) to have a value of "R"


Excel example
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 39717606
Does that mean an "R" should appear in O63 if any of the column col O values appear outside the col E/col F range for that respective row? If so try this formula in O63

=IF(SUMPRODUCT((O2:O60>F2:F60)+(O2:O60<E2:E60)),"R","")

If all values are within the range then you get a blank, otherwise an "R"

I assumed your range was row 2 to row 60 (I can't see from the screenshot) - change as required.

If that isn't the requirement can you clarify further. What should be in O63 if all the values are inside the ranges?

regards, barry
0
 
LVL 14

Expert Comment

by:Faustulus
ID: 39721018
Perhaps the solution is quite simple:-
[O63] =IF(OR(O4<E4,O4>F4),"R","")

Open in new window

(1) Excel worksheet formulae can't write anything to any cell. Instead, they can display very nearly anything you can imagine in the cell where they reside themselves. This means, if you wish to display something in cell O63 you must plan on placing your formula in that cell and look at the worksheet from there.
(2) From that vantage point it becomes clear that you must not only decide what to write in the cell when your conditions are met but also what to display when they are not. For this purpose Excel provides the IF function.
IF ([condition], [True], [False])
In other words, if the condition evaluates to True the function displays one result, otherwise (since it must be False where it isn't True) another result.

In the function I have suggested above, OR(O4<E4,O4>F4) is the condition. Note how the components are separated by commas. You could enumerate more, but all of them are within parenthesis which are preceded by the function's name (OR) as is Excel's wont.

O63 doesn't appear anywhere in the function because that destination is implied by the location of the formula. Instead, it specifies that nothing ("") should be shown if the condition doesn't evaluate to True.

I hope this helps.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:tmaususer
ID: 39724392
harryhoudini and Faustulus,
I will past these along and see if these work for them.  
Thanks.
0
 

Author Comment

by:tmaususer
ID: 39724409
harryhoudini,
you are correct:
"R" should appear in O63 if any of the column col O values appear outside the col E/col F range for that respective row
0
 

Author Comment

by:tmaususer
ID: 39731669
Thank you harryhoudini!
This is what ended up working:
=IF(SUMPRODUCT((O5:O53>$F$5:$F$53)+(O5:O53<$E$5:$E$53)),"R","A")
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39733345
Well done harry! ;)
0
 

Author Comment

by:tmaususer
ID: 39735859
Opps,
Sorry about the spelling of you name barryhoudini.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now