Index + Match on a table: when sorting table options, I+M breaks

1caiser

New Member
Joined
Mar 31, 2022
Messages
1
Platform
  1. Windows
I have an Index + Match formula working on a table with sorting options.

In terms of the file, when working normally, it is supposed to return a certain set of values depending on what "Stage" is, and returns a value in the corresponding row/column based on what I+M returns. But when I sort away from standard naming (Stage > A to Z), the entire formula breaks, leaving me with either wrong references or #N/As. I am not sure what causes this, as even Formula Auditing > Evaluate Formula gives the wrong results in this case.

For example, when sorting by [Time > A to Z], when Stage = "0-2", the Match formula correctly identifies Row 20, but for some reason Match on Stages "0-3" and "0-4" also return Row 20, when they should be 38 and 40 respectively. Other times, the Match formula simply returns #N/A, even though the specified Stage exists in the G column.

Wondering if there is a fix to get I+M working on tables in different sorting configurations, or if there is a similar formula/combination to get it working as intended.

Sheet download link: Loading Google Sheets

Mini-sheet, maybe this will work for those who don't want to download?
Girls Frontline checklist.xlsx
ABCDEFGHIJKLM
1MPAMMORATNPARTStageMPAMMORATNPARTTime
20-1#N/A#N/A#N/A#N/A1-110301500.25
30-2183.330.000.00116.673-15007500.33
40-3183.330.000.00116.671-20406000.50
50-4183.330.000.00116.675-100100450.50
6Total/hr#N/A#N/A#N/A#N/A9-100100500.50
72-110000300.67
8MPAMMORATNPART3-2012070300.75
90-1#N/A#N/A#N/A#N/A0-1014514500.83
100-2550003501-330030101.00
110-3550003504-1018518501.00
120-4550003508-115015015001.00
13Total#N/A#N/A#N/A#N/A2-2602008001.50
143-30300001.50
159-218001801001.50
161-4160160002.00
174-20002102.00
186-130030001002.00
195-2060030002.50
207-1650065002.50
210-2550003503.00
226-202005501003.00
238-20004503.00
242-31010102304.00
255-38004004004004.00
267-2065003004.00
279-3750750004.50
283-4003003005.00
296-3002005005.00
307-390060060005.50
312-40250600606.00
324-3800550006.00
338-340080080006.00
345-4100007007.00
359-450090090007.00
364-44004004001508.00
377-42502502506008.00
388-415004004001009.00
390-390090090025012.00
406-4800800800012.00
410-40120080075024.00
42
Man LogCalcHR
Cell Formulas
RangeFormula
B2:B3B2=INDEX($H$2:$K$41,MATCH($A2,$G$2:$G$41),1)/INDEX($H$2:$L$41,MATCH($A2,$G$2:$G$41),5)
C2:C3C2=INDEX($H$2:$L$41,MATCH($A2,$G$2:$G$41),2)/INDEX($H$2:$L$41,MATCH($A2,$G$2:$G$41),5)
D2:D3D2=INDEX($H$2:$L$41,MATCH($A2,$G$2:$G$41),3)/INDEX($H$2:$L$41,MATCH($A2,$G$2:$G$41),5)
E2:E3E2=INDEX($H$2:$L$41,MATCH($A2,$G$2:$G$41),4)/INDEX($H$2:$L$41,MATCH($A2,$G$2:$G$41),5)
B4:B5B4=IF(ISBLANK(#REF!),0,INDEX($H$2:$K$41,MATCH($A4,$G$2:$G$41),1)/INDEX($H$2:$L$41,MATCH($A4,$G$2:$G$41),5))
C4:C5C4=IF(ISBLANK(#REF!),0,INDEX($H$2:$L$41,MATCH($A4,$G$2:$G$41),2)/INDEX($H$2:$L$41,MATCH($A4,$G$2:$G$41),5))
D4:D5D4=IF(ISBLANK(#REF!),0,INDEX($H$2:$L$41,MATCH($A4,$G$2:$G$41),3)/INDEX($H$2:$L$41,MATCH($A4,$G$2:$G$41),5))
E4:E5E4=IF(ISBLANK(#REF!),0,INDEX($H$2:$L$41,MATCH($A4,$G$2:$G$41),4)/INDEX($H$2:$L$41,MATCH($A4,$G$2:$G$41),5))
B6:E6,B13:E13B6=SUM(B2:B5)
L3L3=2/6
B9:B12B9=IF(ISBLANK($A9),0,INDEX($H$2:$L$41,MATCH($A9,$G$2:$G$41),1))
C9:C12C9=IF(ISBLANK($A9),0,INDEX($H$2:$L$41,MATCH($A9,$G$2:$G$41),2))
D9:D12D9=IF(ISBLANK($A9),0,INDEX($H$2:$L$41,MATCH($A9,$G$2:$G$41),3))
E9:E12E9=IF(ISBLANK($A9),0,INDEX($H$2:$L$41,MATCH($A9,$G$2:$G$41),4))
L7L7=40/60
L8L8=45/60
L9L9=50/60
A9:A12A9=A2
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
You haven't specified the final argument in the Match function so it's doing an approximate match & for that to work the data has to be sorted A-Z.
For B2 try it like
Excel Formula:
=INDEX($H$2:$K$41,MATCH($A2,$G$2:$G$41,0),1)/INDEX($H$2:$L$41,MATCH($A2,$G$2:$G$41,0),5)
 
Upvote 0

Forum statistics

Threads
1,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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