Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel. Nested vlookup with offset

Posted on 2012-12-30
4
Medium Priority
?
665 Views
Last Modified: 2012-12-30
Hello Experts,

I am trying to write a formula that will work in Excel 2003 and 2010, It has a vlookup range with an offset.  I am not sure if this is possible to combine these 2 in the same formula - I was hoping to find a work-around since I am using this formula numerous times throughout my workbook.
I prefer it to be a formula and not computed in a vba cell change routine.

Right now the formula that errors out is:

=C20*(vlookup($F$1,INFO!$A$1:$B$60,2(offset,1,1),false))+IF(C20>40,(C20-40)*(vlookup($F$1,INFO!$A$1:$B$60,2(offset,1,1),false)/2),0)

If needed - here are a few tidbits:

F1 is cell that contains the month on that worksheet.  (I have 12 monthly sheets)
Range INFO!A1:B60 is a constant.
   with A1 being January with the remaining months listed down the column with 4 rows of  names listed under each month.
   Column B being the respective payrates of the individuals in the 4 rows.

The formula should find the month then take the payrate which is over 1 column and down 1 row and multiply by the value in C20 and if any hours are greater than 40 then multiply that offset figure.
(C20 is the amount of hours and will be modified for each of the corresponding folks C20, C21, C22, C23 - after I get the formula to work correctly)

Any help would be appreciated,
Thank you,
Michael
0
Comment
Question by:mike637
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 50

Expert Comment

by:barry houdini
ID: 38731257
Hello Michael,

To find a match and go down 1 row and right 1 column you can use INDEX/MATCH, e.g.

=INDEX(Info!B$2:B$61,MATCH($F$1,Info!A$1:A$60,0))

[Note that the first range is "offset" by 1 row and column from the range in the MATCH function]

If F1 matches with A40, for example, that formula will give you the value in B41. You can change the outcome by changing the first range (in the INDEX function) accordingly.

I'm not clear where the +40 hours value comes from, post back if you can't amend the above for that.....

regards, barry
0
 

Author Comment

by:mike637
ID: 38731282
Hi Barry,

The 40 is regular pay and anything over 40 is time & half. Hence, my calculation is taking their payrate found in the index and multiplying by the amount of hours in [C20] for straight pay then if the hours > 40, it subtracts 40 and calcs those hours * 1/2 the rate found in the index.

The total value = the gross pay.

I hope this helps to understand what I am computing.

Thanks,
Michael
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 2000 total points
ID: 38731300
OK, does the formula I suggested give you the rate you want? I'm not sure whether a name has to come into the equation?

If anything over 40 hours is time & half then you could use this formula for total hours (including the extra half time), e.g. 50 in C20 will return 55 (40+10*1.5)

=C20+MAX(C20-40,0)/2

so if my previous formula is correct you can just multiply those, i.e.

=(C20+MAX(C20-40,0)/2)*INDEX(Info!B$2:B$61,MATCH($F$1,Info!A$1:A$60,0))

regards, barry
0
 

Author Comment

by:mike637
ID: 38731313
Barry,

Thank you!  It worked perfectly.

You are too damn smart. :)

Michael
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question