Selective comparison

tigerzen

Board Regular
Joined
Mar 8, 2023
Messages
165
Office Version
  1. 365
Platform
  1. Windows
A number of tables are received each week and a variation table (I think there's a more official name for this but not sure what it is) is required. What's needed is a table indicating the differences in values between tables. Desired results are in rows 12 to 16, my initial attempt is in rows 6 to 10 but it doesn't account for the other table. I was thinking the CHOOSE function might be the most appropriate way to do this but couldn't quite get it to work. Looking for a formula based solution using Excel 2019.

Book1
BCDEFGHIJKLMNOPQRST
1Team 1JanFebMarchTeam 2JanFebMarchTeam 3JanFebMarchTeam 4JanFebMarch
2Staff numbers342940Staff numbers172021Staff numbers505546Staff numbers553544
3Absences4510Absences238Absences1076Absences680
4Promotions230Promotions132Promotions628Promotions353
5
6CompareTeam 1versusTeam 3
7JanFebMarch
8Staff numbers342940
9Absences4510
10Promotions230
11
12CompareTeam 1versusTeam 3
13JanFebMarch
14Staff numbers16266
15Absences62-4
16Promotions4-18
Sheet6
Cell Formulas
RangeFormula
C8:E10C8=INDEX($B$1:$T$4,MATCH($B8,$B$1:$B$4,0),MATCH(C$7,$B$1:$T$1,0))
Cells with Data Validation
CellAllowCriteria
C6ListTeam 1,Team 2,Team 3, Team 4
E6ListTeam 1,Team 2,Team 3, Team 4
C12ListTeam 1,Team 2,Team 3, Team 4
E12ListTeam 1,Team 2,Team 3, Team 4
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
How about:

Book1
ABCDEFGHIJKLMNO
1Team 1JanFebMarchTeam 2JanFebMarchTeam 3JanFebMarch
2Staff numbers342940Staff numbers172021Staff numbers505546
3Absences4510Absences238Absences1076
4Promotions230Promotions132Promotions628
5
6
7
8
9
10
11
12CompareTeam 1versusTeam 3
13JanFebMarch
14Staff numbers16266
15Absences62-4
16Promotions4-18
Sheet3
Cell Formulas
RangeFormula
C14:E16C14=INDEX($C$2:$Z$4,ROWS(C$14:C14),MATCH($E$12,$B$1:$Z$1,0)+COLUMNS($C14:C14)-1)-INDEX($C$2:$Z$4,ROWS(C$14:C14),MATCH($C$12,$B$1:$Z$1,0)+COLUMNS($C14:C14)-1)
Cells with Data Validation
CellAllowCriteria
C12ListTeam 1,Team 2,Team 3,Team 4
E12ListTeam 1,Team 2,Team 3,Team 4
 
Upvote 0
This is sort of clunky as you have to update the ABSOLUTE reference in each comparison block to capture the "area" number for the INDEX function.
But it works:
Mr excel questions 59.xlsm
ABCDEFGHIJKLMNOPQRST
1Team 1JanFebMarchTeam 2JanFebMarchTeam 3JanFebMarchTeam 4JanFebMarch
2Staff numbers342940Staff numbers172021Staff numbers505546Staff numbers553544
3Absences4510Absences238Absences1076Absences680
4Promotions230Promotions132Promotions628Promotions353
5
6CompareTeam 1versusTeam 3
7JanFebMarch
8Staff numbers16266
9Absences62-4
10Promotions4-18
Sheet1
Cell Formulas
RangeFormula
C8:E10C8=INDEX(($B$1:$E$4,$G$1:$J$4,$L$1:$O$4,$Q$1:$T$4),MATCH($B8,$B$1:$B$4,0),MATCH(C$7,$B$1:$E$1,0),RIGHT($E$6,1))- INDEX(($B$1:$E$4,$G$1:$J$4,$L$1:$O$4,$Q$1:$T$4),MATCH($B8,$B$1:$B$4,0),MATCH(C$7,$B$1:$E$1,0),RIGHT($C$6,1))
 
Upvote 0
Thanks so much Eric and Awoohaw, both solutions work admirably!
 
Upvote 0

Forum statistics

Threads
1,215,080
Messages
6,123,013
Members
449,093
Latest member
ikke

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