Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-20-2012, 10:24 AM
Colin Legg's Avatar
Colin Legg Colin Legg is offline AND function be used as criteria in DB functions? Windows 7 32bit AND function be used as criteria in DB functions? Office 2010 32bit
Expert
 
Join Date: Jan 2011
Location: UK
Posts: 369
Colin Legg will become famous soon enough
Default

Oh, but you can use formulas which return TRUE or FALSE as criteria too. For calculated criteria like this, you must leave the column header blank. For example, in the helpfile:
Quote:
Criteria created as the result of a formula





You can use a calculated value that is the result of a formula as your criterion. Remember the following important points:
  • The formula must evaluate to TRUE or FALSE.
  • Because you are using a formula, enter the formula as you normally would, and do not type the expression in the following way: =''=entry''
  • Do not use a column label for criteria labels; either keep the criteria labels blank or use a label that is not a column label in the range (in the examples below, Calculated Average and Exact Match). If you use a column label in the formula instead of a relative cell reference or a range name, Excel displays an error value such as #NAME? or #VALUE! in the cell that contains the criterion. You can ignore this error because it does not affect how the range is filtered.
  • The formula that you use for criteria must use a relative reference to refer to the corresponding cell in the first row (in the examples below, C7 and A7).
  • All other references in the formula must be absolute references of criteria created as the result of a formula.
So with your formula:
=AND(E4>F9,D7<A5,M3>G1,B1=“FY 2010”)

It should return TRUE if all 3 criteria are met or FALSE if they aren't. When you use it in your criteria range, provided you have followed the rules in the helpfile, it should act as a filter accordingly.
Reply With Quote
  #2  
Old 11-20-2012, 10:28 AM
56_kruiser 56_kruiser is offline AND function be used as criteria in DB functions? Windows 7 64bit AND function be used as criteria in DB functions? Office 2010 64bit
Novice
AND function be used as criteria in DB functions?
 
Join Date: Nov 2012
Posts: 26
56_kruiser is on a distinguished road
Default

Quote:
Originally Posted by Colin Legg View Post
Oh, but you can use formulas which return TRUE or FALSE as criteria too. For calculated criteria like this, you must leave the column header blank. For example, in the helpfile:
Funny. I read that a bit ago, and it didn't sink in. I was focused on a different aspect.

Ok. I may be wrong, but it seems to me that the only case where you would use a criteria that evaluates to True or False is in a situation where you would want to return either All or None of the DB that is being referenced. Would that be right? It seems to me that is all that could happen when using True or False as a criteria.
Reply With Quote
  #3  
Old 12-06-2012, 01:28 PM
56_kruiser 56_kruiser is offline AND function be used as criteria in DB functions? Windows 7 64bit AND function be used as criteria in DB functions? Office 2010 64bit
Novice
AND function be used as criteria in DB functions?
 
Join Date: Nov 2012
Posts: 26
56_kruiser is on a distinguished road
Default

Quote:
Originally Posted by Colin Legg View Post
Oh, but you can use formulas which return TRUE or FALSE as criteria too. For calculated criteria like this, you must leave the column header blank. For example, in the helpfile:

So with your formula:
=AND(E4>F9,D7<A5,M3>G1,B1=“FY 2010”)

It should return TRUE if all 3 criteria are met or FALSE if they aren't. When you use it in your criteria range, provided you have followed the rules in the helpfile, it should act as a filter accordingly.
By the way...anyone reading this thread...if you read my original post, the problem and hence my conofusion, is that the third argument -> B1-"FY 2010", is not a third criteria, but the results displayed if the first two arguments, as criteria, is true.

My thought is that the entire example is incorrect, and that the third argument in the AND would be criteria, not results.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Acos, Cos and Sin functions in DAX PowerPivot eramzan Excel 0 03-01-2012 11:32 AM
Using IF and Vlookup functions cpladson Excel 3 12-14-2011 11:57 PM
AND function be used as criteria in DB functions? Assign functions to F1, etc. ibclare Office 4 06-02-2011 03:22 PM
AND function be used as criteria in DB functions? ** Using Functions djreyrey Excel Programming 10 02-08-2011 04:18 PM
Automated Functions?? nickypatterson Outlook 0 08-27-2009 01:50 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:46 AM.


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