We help IT Professionals succeed at work.

Vlookup Macro

Last Modified: 2012-02-12
I was wondering is there a way to make a vlookup macro? The only problem I have is the data changes daily and the pivot width and height change. For example

                Sev1  Sev2  sev 3  Total
name1       1         2        3       6
name 2      2         2        4       8
name 3      3         3        5       11
name 4      4         1        2        7

My pivot looks something like this. Each day I pull reports and create a pivot in excel. The pivot changes everyday, because if one of the techs have not done any work then they wont show up in the pivot. Also, if we don't get one of the SEV type tickets that column will not appear. I run a vlookup to get the number of tickets people do everyday. I was wondering if I can automate the process with a macro? Again, keep in mind the height and width change daily. Any help would be appreciated!
Watch Question

Most Valuable Expert 2011
Awarded 2010
This one is on us!
(Get your first solution completely free - no credit card required)
Top Expert 2010

When you "pull reports", does that mean that you are dumping data into an Excel worksheet, and then using that as the source for your PivotTable?

If so, then I would just go with a simple formula.  Since you are in Excel 2007, COUNTIFS may come in handy.

For example, see the attached workbook:


There I have a Table on the worksheet Data, a roster of tech names and severities on the worksheet Results, and I use a formula to grab the result for each agent by severity.  If any agents or severity levels are missing in the source data, the formula returns zero:

=COUNTIFS(Table1[Tech Name],$A2,Table1[Severity],B$1)
Edward PamiasTeam Lead RRS Desk
Top Expert 2016


This worked great! Thanks!  Also thanks to everyone else for their input!

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.