Sort not working correctly when using Index Match Formula

Sundance_Kid

Board Regular
Joined
Sep 2, 2017
Messages
128
Office Version
  1. 365
Platform
  1. Windows
Hi,

I am using an index/match formula to return values off a pivot table. I then have added in another column which sums up the total.

However, when I click on sort in the total column, to sort from largest to smallest, it doesnt sort correctly and ends up messing up the index/match formula. It seems to sort the persons name bt the formula then changes where it is looking up a different cell.

Is there something to be aware of when using Sort and index/match?

Attached Xl2bb

Thanks
IndexMatchSort Issue.xlsx
BCDEFGH
2Name Feb-22 Mar-22 Apr-22 May-22 Jun-22Total
3Shane49158945
4Paul113159918146
5Mary5612451219144
6Mark565682228179
7Luke0115613
8John115163756125
9Joan5632117
10Total13351163185137669
Sheet3
Cell Formulas
RangeFormula
C3:G9C3=INDEX(Sheet2!$D$4:$H$10,MATCH(Sheet3!$B3,Sheet2!$C$4:$C$10,0),MATCH(Sheet3!C$2,Sheet2!$D$3:$H$3,0))
H3:H10H3=SUM(C3:G3)
C10:G10C10=SUM(C3:C9)
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Remove all references to Sheet3 in the formula. You should never refer to the sheet the formula is on, just use the cell reference
 
Upvote 1
Solution
Remove all references to Sheet3 in the formula. You should never refer to the sheet the formula is on, just use the cell reference
That worked perfectly. Thank you!!

Out of interest, should you never refer to the sheet the formula is on for all formulas or just when using index/match? As sometimes it is easier when moving between tabs to just click on the cell you may need which may add in the sheet to the formula.
 
Upvote 0
Out of interest, should you never refer to the sheet the formula is on for all formulas or just when using index/match?
Best for all formulas, especially if sorting might be involved.

You can still click the cells to build your formula if you want, but afterwards, edit it to remove the active sheet name(s) from your formula before copying to other cells.
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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