Return value from table based on date and amount

Aubrey Reel

New Member
Joined
Apr 4, 2023
Messages
7
Office Version
  1. 365
Platform
  1. Windows
How do I return the Position from Table 2 to Column H in Table 1 using the below criteria:

date_week_ended year from Table 1 match to the corresponding column in Table 2
AND
Hourly Rate from Table 1 that is within the range of pay listed in Table 2 (e.g. for Year 2016 Tech 1 range = $11-13.99, Tech 2 range = $14-17.99, etc)

For example:
date_week_ended = 3/31/2016
Hourly Rate = $13.50
Position = Tech 1

Any help appreciated - I am running myself in circles on this one!

1680638508159.png



1680638517430.png
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
a grid lookup should work - if the years in table 2 are text

But where is the position in table 1 to lookup ?
 
Upvote 0
for example here

Book1
ABCDEFGHIJK
1emp nodate weeke endinghourly rate
212/1/1610
323/1/18#N/A
435/1/23224
5
6
7
8
9
10
11201620172018201920202021202220232024
121101214161820222426
133210212214216218220222224226
14
15
16
Sheet1
Cell Formulas
RangeFormula
F2:F4F2=INDEX($B$12:$J$17,MATCH(A2,$A$12:$A$17,0),MATCH(YEAR(B2),B$11:J$11,0))
B13:J13B13=B12+200
 
Upvote 0
I was thinking some sort of index/match too but couldn't get anything to work. The Position (.e.g Tech 1, Tech 2) is what I am trying to pull into Table 1. Table two contains the starting rate for each position by year. Each employees position is based on their pay - so an employee who starts as a Tech 1 becomes a Tech 2 when they reach the $14 pay rate, and then an Operator when they reach $18, etc. To pull the Position into Table 1, I need to look up the year they worked (based on date_week_ended column) and how much they were being paid per hour (Hourly Rate column) to determine what their Position was at that time. I need this information in order to calculate average hourly rate by position for each historical quarter. Below are the images with the column and row numbers visible.

Table 1
1680698661966.png


Table 2
1680698682508.png
 
Upvote 0
ok, so not 100% following

you want to look down the column based on the year
so the green highlight is
3/31/2016 - column B - Table 1
so look down the 2016 column and find the Hourly rate - Table 2 column B
which is 13.50 Column F table 1

BUT 13.50 does not exist in table 2 column B 2016
so now what do you want to do

if it had existed , then you want to return the Position from table 2 column A
 
Upvote 0
The $13.50 would be in the range $13-14.99 for a Tech 1 in year 2016. So the formula would have to somehow reference greater than or equal to $13.50 and less than $15.00, which is the starting rate of the next Position level of Tech 2 in 2016, and return Tech 1. Each year, the ranges for each position would be different, although the data currently is just a plug for illustration.
 
Upvote 0
thanks for that
not sure i know how to do that , I have examples of how i can get the horizontal header from an exact number in a grid, not sure on the greater than and row label

just to clarify further

as its 13.50 - then the next greater is !5 , which is Tech2

somehow reference greater than or equal to $13.50 and less than $15.00, which is the starting rate of the next Position level of Tech 2 in 2016, and return Tech 1.
Which means not the greater value , but the lower value.. as you said
range $13-14.99 for a Tech 1

I'll continue to have a look
BUT also
You show as having version 2010

is that the version you are using , as a solution may be very different if you have later versions
 
Upvote 0
Thank you for trying to help. I believe I am still running version 2010 - below are the screenshots. If it helps, Table 2 can be set up pretty much any way as long as it has the same info.

Account info in Excel:
1680715014745.png


About info on PC:
1680715040694.png
 
Upvote 0
I have changed table 2 so that i/you could see how the formulas progress. But, try this:

This is using date values in all cells that are date appropriate. even the headers in table 2, which is why you see the YEAR function in the formulas. Also, this should work with nearly all versions of excel, at least as far back as 2010.

mr excel questions 22.xlsm
ABCDEFGHIJK
1Table1
2Employee_nodate_week_endedregular_hoursregularhourly_ratePosition
313792016-03-3113.5Tech 1
413782017-03-3114.5Tech 1
54582019-03-3118Tech 2
613112023-03-3125Operator
7
8Table2
9Starting Rates
10Position2016201720182019202020212022202320242025
11Tech 11313.7514.515.31616.7517.518.251919.8
12Tech 21515.7516.517.31818.7519.520.252121.8
13Operator1818.7519.520.32121.7522.523.252424.8
14Foreman2020.7521.522.32323.7524.525.252626.8
aubrey reel
Cell Formulas
RangeFormula
G3:G6G3=INDEX($A$11:$A$14,MATCH($F3,INDEX($B$11:$K$14,1,MATCH(YEAR(B3),YEAR($B$10:$K$10),0)):INDEX($B$11:$K$14,ROWS($B$11:$B$14),MATCH(YEAR(B3),YEAR($B$10:$K$10),0)),1))
 
Last edited:
Upvote 0
Solution

Forum statistics

Threads
1,216,172
Messages
6,129,289
Members
449,498
Latest member
Lee_ray

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top