Vlookup formula not changing properly

Steviefiege

Board Regular
Joined
Aug 29, 2018
Messages
66
Hi,
I have 14 columns with Vlookup formula's in them, here's one for example:

=IFERROR(VLOOKUP($B4,'Main Squad'!$A:$AM,MATCH(Sheet1!C4,'Main Squad'!$A$17:$AM$17,0),0),"")

They all work fine, until i use the sort button in the table there in. When i click on the persons name to put it in alphabetical order, where i've put the formula in bold it goes haywire. Instead of goin down c4, c5, c6 etc... like i want it too it keeps the original number in so it could say for example c4, c5, c57, c6, etc. How do i stop it from doing that?

Rgs
Steve
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
What is the name of the sheet that this formula is on?
 
Upvote 0
The name of the sheet that the formula is on is called 'Player Position Availability'. In the formula, the Sheet1!C4 is actually just called Sheet1, its just my working out page.
 
Upvote 0
The name of the sheet that the formula is on is called 'Player Position Availability'. In the formula, the Sheet1!C4 is actually just called Sheet1, its just my working out page.
I didn't understand that.

You quoted a formula
=IFERROR(VLOOKUP($B4,'Main Squad'!$A:$AM,MATCH(Sheet1!C4,'Main Squad'!$A$17:$AM$17,0),0),"")

Is that exact formula on 'Sheet1' or is it on 'Player Position Availability'?


If the above formula is not the exact formula you are using that you are having the sorting problem with, what is the exact formula and what sheet is it on?
 
Last edited:
Upvote 0
That exact formula is on 'Player Position Availability'

The formula in Sheet1 is this:
=IF(VLOOKUP('Player Position Availability'!$Q3,Positions!$A:$O,COLUMNS($A$3:A3)+1,0)="","",VLOOKUP('Player Position Availability'!$Q3,Positions!$A:$O,COLUMNS($A$3:A3)+1,0))
 
Upvote 0
References to other worksheets will move as the cells are sorted. If you don't want that, you'll need to use something like an INDEX formula. Assuming a formula in row 4, you'd use something like:

=IFERROR(VLOOKUP($B4,'Main Squad'!$A:$AM,MATCH(INDEX(Sheet1!C:C,ROW()),'Main Squad'!$A$17:$AM$17,0),0),"")

IMO, this is a weird layout.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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