braydon16,
I created a UDF named OLOOKUP (for OccurrenceLookup) which has the following format:
=OLOOKUP(LookupValue, SourceList, ReturnList, OccurrenceIndex)
Notes:- LookupValue is the criteria you're searching for. In this case, it would be "true"
- This is not case sensitive
- SourceList is the range of cells that contains the criteria. In this case, it would be the range of cells in column E of Sheet1 (containing True and False for the checkboxes)
- ReturnList is the range of cells that contain the values you want returned. In this case, it would be the range of cells in column B of Sheet1 (the description)
- OccurrenceIndex is which number in the occurrences you're looking for. So if you need the result of the second occurrence, this should be 2
I have attached a sample workbook based on your post so you can see how it works.
To add a UDF to a workbook:- Save a copy of the Excel workbook you want to modify
- Always test macros in a copy so that the original is preserved in case the modifications don't go smoothly
- Open the copy of the Excel workbook you want to modify
- Use the keyboard shortcut ALT+F11 to open the Visual Basic Editor
- Insert -> Module
- Copy/Paste the code into that area
To use a UDF in a workbook, simply type it into a cell like you would any other Excel formula. In the sample workbook, I have attached, the formula in the Results page, cell A2 is:
=OLOOKUP("true",'TrueFalse Items'!$E$2:$E$11,'TrueFalse Items'!$B$2:$B$11,1)
Hope this helps,
~tigeravatar
Bookmarks