Unexpected and inconsistent error with ranking rows based on criteria

Joined
Mar 26, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi, I have a table similar to the below, and I am trying to use formulae to rank the rows in order, by Total Actual, Budget Variance, Forecast Variance etc. I am wanting the output to be something that says, North 1, North 2, North 3, so that I can use index match on another tab to pull through the specific rows I want. I do not need to account for duplicates, I already have that step working. I am using Office 365 on a Windows computer.

The problem I have is that for some bizarre reason, in the 200 rows of data, five regions, and three comparative scenarios, I have five entries where the formula is kicking out the wrong answer.

As an example, using the below, if I were looking for the project with the largest vs Budget result in North, I would want to see Project C. What is happening is that both Project A and Project C are coming back as being Number 2 in the vs Budget Step 1 column. I have poured through the data, as have two other people, and we cannot understand why we are getting this solitary glitch, when all of the other instances in the vs Budget column are working perfectly. I have manually checked the data and there are no hidden rows for other North projects, and no higher variances in any region for that matter. All formatting appears consistent. A test was done of swapping where the formulae look in columns G & H, and I&J, and the exact same problem occurred. Tried swapping to look at Last Year, and it is only in the specific instance of the vs Budget.

Does anyone have any ideas please on what might be causing this gremlin? There are no hard-codings, all formulae are operational, formula updating is on automatic. Any guidance you can give is greatly appreciated.

If I have forgotten to provide any information, I apologise, please let me know and I will add it in right away.

Many thanks

ABCDEFGHIJ
ProjectRegionActualvs Budgetvs Forecastvs Last Yearvs Budget Step 1vs Budget Step 2vs Forecast Step 1vs Forecast Step 2
ANorth3510515=IFERROR(COUNTIFS(B$2:B$5,B2,D$2:D$5,">"&D2)+1,0)=B2&" "&G2=IFERROR(COUNTIFS(B$2:B$5,B2,E$2:E$5,">"&E2)+1,0)=B2&" "&I2
BNorth5051020=IFERROR(COUNTIFS(B$2:B$5,B3,D$2:D$5,">"&D3)+1,0)=B3&" "&G3=IFERROR(COUNTIFS(B$2:B$5,B3,E$2:E$5,">"&E3)+1,0)=B3&" "&I3
CNorth10152010=IFERROR(COUNTIFS(B$2:B$5,B4,D$2:D$5,">"&D4)+1,0)=B4&" "&G4=IFERROR(COUNTIFS(B$2:B$5,B4,E$2:E$5,">"&E4)+1,0)=B4&" "&I4
DSouth4002020=IFERROR(COUNTIFS(B$2:B$5,B5,D$2:D$5,">"&D5)+1,0)=B5&" "&G5=IFERROR(COUNTIFS(B$2:B$5,B5,E$2:E$5,">"&E5)+1,0)=B5&" "&I5
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
In my spreadsheet I have no ties with region North.

Mappe11
ABCDEFGHIJ
1ProjectRegionActualvs Budgetvs Forecastvs Last Yearvs Budget Step 1vs Budget Step 2vs Forecast Step 1vs Forecast Step 2
2ANorth35105152North 23North 3
3BNorth50510203North 32North 2
4CNorth101520101North 11North 1
5DSouth40020201South 11South 1
Tabelle1
Cell Formulas
RangeFormula
G2:G5G2=IFERROR(COUNTIFS(B$2:B$5,B2,D$2:D$5,">"&D2)+1,0)
H2:H5H2=B2&" "&G2
I2:I5I2=IFERROR(COUNTIFS(B$2:B$5,B2,E$2:E$5,">"&E2)+1,0)
J2:J5J2=B2&" "&I2
 
Upvote 0
In my spreadsheet I have no ties with region North.

Mappe11
ABCDEFGHIJ
1ProjectRegionActualvs Budgetvs Forecastvs Last Yearvs Budget Step 1vs Budget Step 2vs Forecast Step 1vs Forecast Step 2
2ANorth35105152North 23North 3
3BNorth50510203North 32North 2
4CNorth101520101North 11North 1
5DSouth40020201South 11South 1
Tabelle1
Cell Formulas
RangeFormula
G2:G5G2=IFERROR(COUNTIFS(B$2:B$5,B2,D$2:D$5,">"&D2)+1,0)
H2:H5H2=B2&" "&G2
I2:I5I2=IFERROR(COUNTIFS(B$2:B$5,B2,E$2:E$5,">"&E2)+1,0)
J2:J5J2=B2&" "&I2
This is the problem I have, that it works perfectly 99% of the time and then there’s just these specific instances where it doesn’t. Tomorrow I’ll strip out the confidential info and upload a copy so you can see.
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,177
Members
452,615
Latest member
bogeys2birdies

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