Solved

# tricky lookup formula

Posted on 2014-02-10
211 Views
Hi Experts excel 2007

I need to look up based on staff id when member of staff was contacted.
And insert results as shown into table b.

Assume table A pivot table...sample date total date set 20000 staff id's
Col b
Dates row 1. 12/01/2014.      13/01/2014
col A
3456.                       1.                           1
1234.                       1
5678.                                                      1
9890.

The number 1 shows as a count that person was called only once on that date..

Table B
Col e.           Col f.                    Col g.
3456.           12/01/2014.     13/01/2014
Etc...
0
Question by:route217

LVL 23

Expert Comment

If this is complex, it may be easier for us to help if you can use Attach File to add a sample of your data?
0

LVL 80

Accepted Solution

byundt earned 500 total points
You might consider using an array-entered formula like:
=IFERROR(SMALL(IF(INDEX(Sheet1!\$B\$2:\$D\$20000,MATCH(\$E2,Sheet1!\$A\$2:\$A\$20000,0),)<>0,Sheet1!\$B\$1:\$D\$1,""),COLUMNS(\$F2:F2)),"")

This formula may be copied down and across. It assumes your PivotTable is in Sheet1 cells A1:D20000.

To array-enter a formula:
1.  Select the cell and click in the formula bar
2.  Hold the Control and Shift keys down
3.  Hit Enter, then release all three keys
Excel should respond by adding curly braces { } surrounding the formula. If it does not (or if you see all blanks as you copy down and across), then repeat steps 1 to 3.

## Important

Because the formula is taking its data from a PivotTable, it is important that you copy and paste the formula in the formula bar or type it in. Do not point to cells in the PivotTable to build the formula, because you will make GETPIVOTDATA function references instead--and they won't do what you need.
TrickyLookupQ28361051x.xlsx
0

Author Comment

Thanks for the feedback much appreciated.
0

## Featured Post

This tutorial explains how to create a series of drop-down lists that are dependent upon prior selections to guide (“force”) the user to make the correct selection and reduce data errors within Microsoft Excel. Excel 2010 was used for this tutorial;…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.