Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-11-2014, 10:05 AM
Gary Drumm Gary Drumm is offline How does this Conditional Format work? Windows XP How does this Conditional Format work? Office 2007
Advanced Beginner
How does this Conditional Format work?
 
Join Date: Mar 2012
Posts: 86
Gary Drumm is on a distinguished road
Default How does this Conditional Format work?

=((TYPE(H4)<>2)*(H4<>""))*OR(H4<$E4,H4>$G4)



I had help getting this conditional format, which highlights a cell if its' contents fall outside a min. max range on the spreadsheet.

I really don't understand how it works though.

Can someone explain it to me please?

Thanks,
Gary
Reply With Quote
  #2  
Old 04-15-2014, 07:49 PM
gebobs gebobs is offline How does this Conditional Format work? Windows 7 64bit How does this Conditional Format work? Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

These are two 2x2 matrices multiplied in series.

The first is the result of a multiplication of two tests, which is basically an AND test if I'm thinking straight.

If H4 is not text (i.e. not Type=2) AND if H4 is not blank, then TRUE, otherwise FALSE. The second part, I would prefer ISBLANK(H4). Thus I would write it...

=AND(TYPE(H4)<>2,ISBLANK(H4))

The second is an OR of H4<E4 and H4>G4. Obviously, an equivalence in either, H4 equals E4 or G4, would result in a FALSE.

Thus, if either E4>H4 OR H4>G4, Then TRUE, otherwise FALSE.

The end result is a number, either 1 or 0, TRUE or FALSE, etc. That result I suppose is conditionally formatted. If you could attach a sample sheet, I could see how it works. It seems kludgy.
Reply With Quote
  #3  
Old 04-16-2014, 03:24 AM
macropod's Avatar
macropod macropod is offline How does this Conditional Format work? Windows 7 32bit How does this Conditional Format work? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

It's basically equivalent to:
=AND(TYPE(H4)<>2,H4<>"",OR(H4<$E4,H4>$G4))
or:
=(TYPE(H4)<>2)*(H4<>"")*((H4<$E4)+(H4>$G4))
or:
=AND(TYPE(H4)<>2,NOT(ISBLANK(H4)),OR(H4<$E4,H4>$G4 ))

gebobs: ISBLANK(H4) is not equivalent to H4<>"", but NOT(ISBLANK(H4)) is.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #4  
Old 04-16-2014, 03:49 AM
gebobs gebobs is offline How does this Conditional Format work? Windows 7 64bit How does this Conditional Format work? Office 2010 64bit
Expert
 
Join Date: Mar 2014
Location: Atlanta
Posts: 837
gebobs has a spectacular aura aboutgebobs has a spectacular aura about
Default

Quote:
Originally Posted by macropod View Post
gebobs: ISBLANK(H4) is not equivalent to H4<>"", but NOT(ISBLANK(H4)) is.
Hah...of course.
Reply With Quote
  #5  
Old 04-16-2014, 05:27 AM
Gary Drumm Gary Drumm is offline How does this Conditional Format work? Windows XP How does this Conditional Format work? Office 2007
Advanced Beginner
How does this Conditional Format work?
 
Join Date: Mar 2012
Posts: 86
Gary Drumm is on a distinguished road
Default

Thanks,
I'll study that.
I think I may find uses for it elsewhere.

Gary
Reply With Quote
  #6  
Old 04-16-2014, 09:53 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline How does this Conditional Format work? Windows 7 64bit How does this Conditional Format work? Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Also keep in mind that TYPE()2 will yield TRUE for numbers but also for error values ,logical values or arrays. So perhaps =TYPE()=1 would be safer
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #7  
Old 04-16-2014, 10:09 AM
Gary Drumm Gary Drumm is offline How does this Conditional Format work? Windows XP How does this Conditional Format work? Office 2007
Advanced Beginner
How does this Conditional Format work?
 
Join Date: Mar 2012
Posts: 86
Gary Drumm is on a distinguished road
Default

Safer? In this case, it is referencing numbers only.

But can you explain further, and give me a couple of examples of such error values, logical values and arrays?

I don't think I will get in that deep, but what might be an expected outcome?

I'll give the =TYPE()=1 a try.

=((TYPE(H4)<>2)*(H4<>""))*OR(H4<$E4,H4>$G4)

How would apply your suggestion to this formula?

Thanks,
Gary
Reply With Quote
  #8  
Old 04-16-2014, 12:01 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline How does this Conditional Format work? Windows 7 64bit How does this Conditional Format work? Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,779
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Perhaps this is a bit simpler

Code:
=isnumber(h4)*OR(H4<$E4,H4>$G4)
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
How does this Conditional Format work? Conditional Format cell appearance Excel 2007 Gary Drumm Excel 3 02-22-2014 01:43 AM
How does this Conditional Format work? Applying a conditional format to multiple rows secoo140 Excel 1 10-12-2013 07:19 PM
Table with Conditional Format to Word billyV Excel 9 06-07-2013 08:26 AM
Copy format created by a conditional formatting spk Excel 2 04-10-2013 04:41 AM
How does this Conditional Format work? Conditional format for form drop-down list? pmregan Word 1 09-19-2012 07:09 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:48 AM.


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