How to reference a cell with a column number that corresponds to a particular week?

Rnkhch

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

I'm trying to make a formula like this in order to refer to scores in my "Scores" sheet form a different sheet:

=INDEX(Scores!$A$1:$AP$55,MATCH($A5,Scores!$A$2:$A$55,0),INDIRECT("Scores!"&"COLUMN((TODAY()-WEEKDAY(TODAY(),2)+5))"))

But I can't get the bold part to work correctly in terms of indicating the column number in the INDEX function. In this example, the formula is trying to refer to the column of the current week using
TODAY()-WEEKDAY(TODAY(),2)+5)

Thanks for any input!

08/24/201808/17/201808/10/201808/03/201807/27/2018etc.
student19687939180
student27881849086
student38793909599
etc.

<tbody>
</tbody>
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Try

=INDEX(Scores!$A$2:$AP$55,MATCH($A5,Scores!$A$2:$A$55,0),MATCH(TODAY()-WEEKDAY(TODAY(),2)+5,Scores!$A$1:$AP$1,0))

M.
 
Upvote 0
Thank you! It works well, but I just realized that if this Friday was a holiday and the scores for this week had Thursday's date (i.e. 08/23/2018), then the formula returns N/A. Is there a way to deal with this? Perhaps matching the "current week" to the "MAX written day of the current week" on the Scores sheet?

Thanks a lot!
 
Upvote 0
I think changing that last 0 in the formula to a 1 will give you the behavior you're after.
 
Last edited:
Upvote 0
Just tested, and it doesn't seem to be working. I have a feeling it might be due to the order of the dates which is the opposite of what the MATCH function wants? Any ideas? Thanks a lot!
 
Upvote 0
Code:
=INDEX(Scores!$A$2:$AP$55,MATCH($A5,Scores!$A$2:$A$55,0),MATCH((TODAY()-WEEKDAY(TODAY(),2)+5)-4,Scores!$A$1:$AP$1,-1))

This will hopefully work. Since your dates are in descending order, you can use -1 to look for the first match greater than or equal to your lookup value and then reference Monday of the current week instead of Friday.
 
Upvote 0

Forum statistics

Threads
1,215,393
Messages
6,124,680
Members
449,180
Latest member
kfhw720

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