count index match complexity

ajm

Well-known Member
Joined
Feb 5, 2003
Messages
2,053
Office Version
  1. 365
Platform
  1. Windows
hi folks, Happy New Year to all.

I am working on a little project that compares projections week on week, year to year. 2020 is on one tab, and 2019 on another.


2019
1578981999196.png


2020 tab appears below.
1578981829708.png


Projections are done each week for the next 8 weeks. so in week 1, 2020, (Row 8), projections are in place from the week of 6 Jan to the week of 24 Feb 2020. In week 2, projections are then revised and reposted from the week of 13 Jan to the week of 2 March 2020. week 3, projections are made for the weeks of 20 Jan through to 9 march 2020 and so on.

These projections are updated to actuals as time passes.

The issue i am having is with the year on year comparison. This is calculated in the Improvement line (Row 15). The idea is to compare the latest projection available against the actual result from the prior year. At this stage, the occupancy projection for Week 8 at this site is 277 (in green). The numbers for the same week last year (from the top image) are 286, resulting in a negative Improvement figure of 9.

this is my formula:
VBA Code:
IFERROR((VLOOKUP(COUNT(J$8:J11),$B$8:$BB11,MATCH(J$3,$B$3:J$3,0),1))-(INDEX(SiteA,MATCH(COUNT(J$8:J11),WksSiteA,0),MATCH('2020'!J$3,'2019'!$A$3:$BC$3,0))),"")

Disregarding the Iferror for the moment, I am using the first part of this formula to identify which projection in 2020 to use. in this case, the VLOOKUP returns 277.

1578983569337.png
The INDEX Match Match returns the corresponding figure from the same period last year. The first Match returns the row number and the second returns the column number to use on the 2019 tab.
1578983520402.png


Instead of using the count function as i have to determine which week is the current week, what else could be used instead? as you can see, from the first two images, the current projected Improvement figure for the first week of March is negative 290. this is because the count in the vlookup returns only 1 where i need it to return 2 to identify that this is a week 2 projection

1578984121045.png


Hopefully the length of the post won't deter people from having a crack at helping me out. its doing my head in.

Fingers crossed,

Ajm
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
hi folks, Happy New Year to all.

I am working on a little project that compares projections week on week, year to year. 2020 is on one tab, and 2019 on another.


2019
View attachment 3906

2020 tab appears below.
View attachment 3905

Projections are done each week for the next 8 weeks. so in week 1, 2020, (Row 8), projections are in place from the week of 6 Jan to the week of 24 Feb 2020. In week 2, projections are then revised and reposted from the week of 13 Jan to the week of 2 March 2020. week 3, projections are made for the weeks of 20 Jan through to 9 march 2020 and so on.

These projections are updated to actuals as time passes.

The issue i am having is with the year on year comparison. This is calculated in the Improvement line (Row 15). The idea is to compare the latest projection available against the actual result from the prior year. At this stage, the occupancy projection for Week 8 at this site is 277 (in green). The numbers for the same week last year (from the top image) are 286, resulting in a negative Improvement figure of 9.

this is my formula:
VBA Code:
IFERROR((VLOOKUP(COUNT(J$8:J11),$B$8:$BB11,MATCH(J$3,$B$3:J$3,0),1))-(INDEX(SiteA,MATCH(COUNT(J$8:J11),WksSiteA,0),MATCH('2020'!J$3,'2019'!$A$3:$BC$3,0))),"")

Disregarding the Iferror for the moment, I am using the first part of this formula to identify which projection in 2020 to use. in this case, the VLOOKUP returns 277.

View attachment 3908The INDEX Match Match returns the corresponding figure from the same period last year. The first Match returns the row number and the second returns the column number to use on the 2019 tab.
View attachment 3907

Instead of using the count function as i have to determine which week is the current week, what else could be used instead? as you can see, from the first two images, the current projected Improvement figure for the first week of March is negative 290. this is because the count in the vlookup returns only 1 where i need it to return 2 to identify that this is a week 2 projection

View attachment 3909

Hopefully the length of the post won't deter people from having a crack at helping me out. its doing my head in.

Fingers crossed,

Ajm
Bump
 
Upvote 0
maybe something with Rows() would work?
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

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