Formula to lookup values in specific cells based on values in other cells in the same column

Rnkhch

Well-known Member
Joined
Apr 28, 2018
Messages
528
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have a large table that looks like this:

(week)1111122222etc
(day)1234512345etc
Person178899193959387929081etc
Person281887773728486898593etc
etc

<tbody>
</tbody>


I would like to define a formula that calculates "weekly score improvement" for each person, by subtracting score of week1/day5 from week1/day1 and repeating this for all subsequent weeks, i.e. for instance:

Person1's improvement in week1 = (the score in week1/day1 column) - (the score in week1/day5 column)

How can I use the week and day identifiers to call values from those columns, for each person?

Any input is highly appreciated! Thanks!
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
A
B
C
D
E
F
G
H
I
J
K
L
1
(week)
1​
1​
1​
1​
1​
2​
2​
2​
2​
2​
2
(day)
1​
2​
3​
4​
5​
1​
2​
3​
4​
5​
3
Person1
78​
89​
91​
93​
95​
93​
87​
92​
90​
81​
4
Person2
81​
88​
77​
73​
72​
84​
86​
89​
85​
93​
5
6
1​
2​
7
Person1
-17​
12​
8
Person2
9​
-9​
9
Sheet: Sheet14

Formula in cell B7:
=INDEX($B$3:$K$4, MATCH($A7,$A$3:$A$4,0),MATCH(B$6,$B$1:$K$1,0))-INDEX($B$3:$K$4, MATCH($A7,$A$3:$A$4,0),MATCH(B$6,$B$1:$K$1,0)+4)
 
Upvote 0
Thank you so much! This is an excellent formula :) Just one thing I noticed is that some weeks may have less than 5 days (because of holidays), so the "+4" in the formula would not be able to take care of those. I was thinking to use a "MAX" formula instead of 4 to figure out the maximum number of days in the week and add "MAX-1" instead of 4, is that right? If you could help me add this capability to the formula, I would highly appreciate it. Thanks a lot!
 
Upvote 0
Thank you!

Try this in cell B7:
=INDEX($B$3:$K$4,MATCH($A7,$A$3:$A$4,0),MATCH(B$6,$B$1:$K$1,0))-INDEX($B$3:$K$4,MATCH($A7,$A$3:$A$4,0),MATCH(B$6,$B$1:$K$1,0)+COUNTIF($B$1:$K$1,B$6)-1)
 
Upvote 0
Thank you very much! I'm gonna start applying this to my big data file. This formula will make my scoring process so much easier and faster!

I may need to do some other calculations with my scores as well, which I'll post :)

Awesome forum :)
 
Upvote 0

Forum statistics

Threads
1,215,378
Messages
6,124,604
Members
449,174
Latest member
ExcelfromGermany

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