FindIf array function

Range Operations category - Range Lookup family Home 
What the name means"Find one or more values in a list, depending on criteria"
SyntaxFindIf ( InpList, OutList, Criteria, [FindSwitch], [CritOpts] )
Description
Array FunctionThis function is an array function, returning an array of values as described in the description or narrative of this function. If you don't input as an array function (Ctrl-Shift-Enter in Excel) the first element of the array only wil be returned. Business Functions has a menu option 'Array Tools', which is helpful in expanding and collapsing array functions across ranges.
See AlsoDoIf (Operation, ListIn, [ListOut], Criteria, [CritOpts], [DefValOnErr])
VariableType or ValueDescription
Inputs: (5)
1 InpList Range of Poly The range in a Lookup that the InputValue refers to when it does its lookup.
2 OutList Range of Poly (Optional) The range in a Lookup where the OutputValue is read off from.
3 Criteria Range of Poly (Optional) One or more criteria written in the BF style of writing criteria.
4 FindSwitch Integer (Optional) What you want returned (0=value(s),1=position of found item(s) in input list) (Optional)
5 CritOpts Integer (Optional) One or more Search Options (additive) (Optional)
Output:
Return Value ResultsPoly Range of Poly Range of polymorphic
Defaults and Values

The variable(s) of this function have certain defaults and/or switch values associated with them. Click here to see more.

Range Handling and Constraints

This function has range inputs that are subject to range handling procedures to help reduce input errors and increase flexibility and speed. Click here to see more.

FindSwitch is 0 for returning values, 1 for returning positions.
It's an array function, so it will return all matches, but if you use it a single cell like a normal function it returns just the first match. Note that well: if you use this as a normal function, you get just the value or position of the first match, whereas if you use it as an array function you get all the matched values or positions.
The Criteria is a cell or range of cells with criteria that are combined as 'OR's.
A Criteria can be a value, an inequality ('>=6), or a BF style criteria ('Mod(?,2)=0').
BF Style Criteria

BF style criteria are similar to Excels but their behavour has been extended with the use of the '?' operator to signify the value being tested. The ways to input criteria are:
  • Simple Criteria using >,<,>=,<=, <> and =. These can either be a text argument (">10") or a written in a cell that is referred to in the function ie >10. The criteria are entered in a cell as text (even if you just type in >2, Excel actually understands this internally as text), or entered directly as a text string in a function such as DoIf. You can preface with a ' or leave Excel to interpret them as text.
  • Simple Values that imply an 'equals to', eg 10 written in a cell. These can be entered either as text, date or number or directly into the argument list of a function such as DoIf
  • Developed Criteria, which use the value tested against in more complex ways, perhaps using Excels own functions, such as MOD(?,10)=0. In this way you can use AND() and OR(), eg AND(MOD(?,10)=0,MOD(?,3)=0). The criteria are entered in a cell as text or directly into the functions argument list, and you can preface with a ' or leave Excel to interpret them as text. The value tested against is the '?' and the function internally subsitutes the value into any place (and there can be more than one) where there is a '?'. Developed criteria do not accept cell references or range names however. Instead, you have to convert the contents of what are comparing against to text, for example, with the range names CurYear and EndYear: =DoIf(0,$P$8:$P$38,S8:S38,"and(?>"&TEXT(CurYear,"#")&",?<="&TEXT(EndYear,"#")&")")
  • A List of Criteria. A range of cells is permitted as Criteria for further OR conditions (the default). So each cell represents an 'OR' condition. If you want each cell to be an AND condition, see the variable CritOpts.
Examples
  • Preview of the FindIf example.
  • The above spreadsheet can be accessed from the Quick Reference (on the Business Functions menu), on the Examples menu, or in the Business Functions\Component Examples directory