You are here:



QUESTION: Using Excel 97-2003

I use the following formula to carry staff hours from weekly payroll tabs to a holiday accrual sheet:


The problem I have found is when employees are on the weekly payroll more than once (for example when they are paid at more than one rate) this formula only carries the total hours from the first row, and ignore the rows below which have total hours at different rates.

I've tried adding to the formula to make it search again but I'm having no luck!

Could you advise?



ANSWER: Ellie,

You are correct on the way Vlookup works.  If you need to sum hours from column K based on the value in column A I would suggest


and this will give you the total hours regardless of whether there is one row or multiple rows for that employee. (this assumes hours are stored as numbers which would seem logical)

Tom Ogilvy

[an error occurred while processing this directive]---------- FOLLOW-UP ----------


This formula seemed to work great until random cells came up with #value!

I've checked the format of the cell is general or number which doesn't seem to alter the result.

When I edit the formula the 'save as' box opens with 'update values:wk31' at the top. (as if I was trying to open a new document, and the display at the top is like the title)
I click cancel and get #value!
The formula then looks like this:


I've tried taking out the extra areas but it doesn't work.

I'm not sure if this is a cell issue or a problem with the tab/range being used?!

Please help again!

Many thanks



What you describe sounds like what one gets when they have a bad reference in terms of a bad sheet name.

for example (or to confirm) in a new workbook I entered the formula


and got the update:Sheet4  dialog.  I don't have a Sheet4 in that workbook.  

So it sounds like you don't have a sheet named WK31.  If you think you do it is possible it is really

"WK31 "  or " WK31"   
Try renaming the sheet to just WK31

Tom Ogilvy

About Excel
This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here


All Answers

Answers by Expert:

Ask Experts


Tom Ogilvy


Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]


Extensive experience.

Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.

©2017 All rights reserved.

[an error occurred while processing this directive]