This is the first time I've run across an idea I've had that I've not been able to make work in Excel, and I'd love to hear if there's an obvious fix that I'm missing, or if I'm just going about this entirely the wrong way. What I'm trying to do is create a calculator to figure out a contractor's end date based on their starting date and the number of working days they will complete.
The method I'm currently using involves two worksheets. The second one (Lookup) simply has a list of working days this year in column A - that is, no weekends or public holidays are in it. The first sheet is supposed to do the actual calculation, but I cannot get it to work. I have two cells labelled for the Start Date (C3) and Number of Working Days (C4), both numbers the user would need to input. Then there's a third cell which is supposed to calculate and show the end date - and that's where it all goes wrong. My intention was to use OFFSET with some sort of nested formula that would match the value in C3 with something in column A of Lookup and return the cell address... but nothing seems to work.
Here's the current formula I'm trying to use. I just get a message saying there's an error with my formula - it doesn't even go through the calculation steps:
=OFFSET(ADDRESS(MATCH(C3,Lookup!A1:Lookup!A253,0),1,1,TRUE,"Lookup"),C4-1,0,1,1)
Now, if I put the nested part into a cell alone, it returns the correct cell addresses. If the start date is 02/01/2007 (the first working day this year), the ADDRESS formula correctly identifies cell Lookup!$A$1. There's no problem with the base OFFSET formula, either - it returns the correct end date if I replace the nested formula with a cell address. It just seems like OFFSET won't let me use a nested formula to return a cell address.
If anyone has any ideas on how to make this work, or even an entirely different idea that would let me calculate contract end dates like this, I would be very thankful!
The method I'm currently using involves two worksheets. The second one (Lookup) simply has a list of working days this year in column A - that is, no weekends or public holidays are in it. The first sheet is supposed to do the actual calculation, but I cannot get it to work. I have two cells labelled for the Start Date (C3) and Number of Working Days (C4), both numbers the user would need to input. Then there's a third cell which is supposed to calculate and show the end date - and that's where it all goes wrong. My intention was to use OFFSET with some sort of nested formula that would match the value in C3 with something in column A of Lookup and return the cell address... but nothing seems to work.
Here's the current formula I'm trying to use. I just get a message saying there's an error with my formula - it doesn't even go through the calculation steps:
=OFFSET(ADDRESS(MATCH(C3,Lookup!A1:Lookup!A253,0),1,1,TRUE,"Lookup"),C4-1,0,1,1)
Now, if I put the nested part into a cell alone, it returns the correct cell addresses. If the start date is 02/01/2007 (the first working day this year), the ADDRESS formula correctly identifies cell Lookup!$A$1. There's no problem with the base OFFSET formula, either - it returns the correct end date if I replace the nested formula with a cell address. It just seems like OFFSET won't let me use a nested formula to return a cell address.
If anyone has any ideas on how to make this work, or even an entirely different idea that would let me calculate contract end dates like this, I would be very thankful!