Is there any way around this circular reference error?

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,532
Office Version
  1. 365
Platform
  1. Windows
This table tracks the odds and the rankings for several teams. These odds change every few days. The Δ columns show how the rankings changed since the last previous ranking.
2022 NBA playoff odds.xlsx
CDEFGHIJK
6Team5/6Rank3Δ2-35/3Rank2Δ1-25/1Rank1
7A2001+21503-11752
8B1752-11751+31504
9C1603=01503-21801
10D1504-21602+11703
Sheet3
Cell Formulas
RangeFormula
E7:E10E7=RANK.EQ([@[5/6]],[5/6])
F7:F10F7=[@Rank2]-[@Rank3]
H7:H10H7=RANK.EQ([@[5/3]],[5/3])
I7:I10I7=[@Rank1]-[@Rank2]
K7:K10K7=RANK.EQ([@[5/1]],[5/1])


I would like to combine the rank and Δ columns like this:
2022 NBA playoff odds.xlsx
MNOPQRS
6Team5/6Rank35/3Rank25/1Rank1
7A2001 (+2)1503 (-1)1752
8B1752 (-1)1751 (+3)1504
9C1603 (=0)1503 (-2)1801
10D1504 (-2)1602 (+1)1703
Sheet3


But when I put this equation in H7
VBA Code:
=RANK.EQ([@[5/3]],[5/3]) & " (" & [Rank1]-[Rank2] & ")"

it gets a circular reference error. Is there any way around this?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
I'm not sure why you are getting a circular reference error but I definitely see a problem in what you are trying to do.

The formula you showed for H7 includes this this expression
[Rank1]-[Rank2]
but in your new format, Rank2 is no longer a number, it is text, and you cannot subtract it. Using the data you showed, for row 7 this would be
2 - "3 (-1)"
and it can't be done, it will give you a #VALUE error.

Combining multiple bits of data that is numeric to make it a string is usually counterproductive.
 
Upvote 0
I'm not sure why you are getting a circular reference error but I definitely see a problem in what you are trying to do.

The formula you showed for H7 includes this this expression
[Rank1]-[Rank2]
Did you mean I7? That's the cell that contains the formula you mention. The formula in H7 is =RANK.EQ([@[5/3]],[5/3]).

but in your new format, Rank2 is no longer a number, it is text, and you cannot subtract it. Using the data you showed, for row 7 this would be
2 - "3 (-1)"
and it can't be done, it will give you a #VALUE error.

Combining multiple bits of data that is numeric to make it a string is usually counterproductive.
The table in my second minisheet is all text. It is for illustration only. There are no formulas in any of the cells. I created it by copying the entire first table to the clipboard then pasting the values to the right of the first table. I then edited columns O and Q to show what I want the contents to be.

The formula that gets a circular reference is =RANK.EQ([@[5/3]],[5/3]) & " (" & [Rank1]-[Rank2] & ")". I put it in H7 which I wanted to look like Q7, in the second minisheet.
 
Upvote 0
Does it do what you want if you change it to this:
Excel Formula:
=RANK.EQ([@[5/3]],[5/3]) & " (" & [@Rank1]-[@Rank2] & ")"
Nope. I tried it both with the @s inside and outside the brackets (see H7 & H8).
2022 NBA playoff odds.xlsx
CDEFGHIJK
6Team5/6Rank3Δ2-35/3Rank2Δ1-25/1Rank1
7A2001+21500-11752
8B1752-11750+31504
9C1603=01503-21801
10D1504-21602+11703
Sheet3
Cell Formulas
RangeFormula
E7:E10E7=RANK.EQ([@[5/6]],[5/6])
F7:F10F7=[@Rank2]-[@Rank3]
H7H7=RANK.EQ([@[5/3]],[5/3]) & " (" & @[Rank1]-@[Rank2] & ")"
I7:I10I7=[@Rank1]-[@Rank2]
H8H8=RANK.EQ([@[5/3]],[5/3]) & " (" & [@Rank1]-[@Rank2] & ")"
H9:H10H9=RANK.EQ([@[5/3]],[5/3])
K7:K10K7=RANK.EQ([@[5/1]],[5/1])


Curiously, they don't get the circular reference every time. ????? And they both return the value "0".

Also, when I click on the MiniSheet button, a tiny blue dot appears very briefly (~1 second) with three sets of about 8-10 blue lines with arrow heads from that dot to cells below the tables. It disappears too quickly for me to be able to capture it. What could that be?
 
Upvote 0
I think I know what the problem is. Here's a simple example.

The formulas in G6:G10 do have a circular reference. I am asking Excel to calculate the rank and also use that value to calculate the difference. ($E6-$G6). I do not understand why it returns a zero and not just the error.

Book1
CDEFGHIJK
5Team05/03/22Rank05/06/22Rank (Δ)Rank(Δ)Rank (Δ)Rank (Δ)
6A5846904(0)4(0)4 (0)
7B5658901(4)1(4)1 (4)
8C8128901(1)1(1)1 (1)
9D6037503(0)3(0)3 (0)
10E8616405(-4)5(-4)5 (-4)
Sheet1
Cell Formulas
RangeFormula
G6:G10G6=RANK.EQ($F6,$F$6:$F$10) & " (" & $E6-$G6 & ")"
H6:H10H6=RANK.EQ($F6,$F$6:$F$10)
I6:I10I6="(" & $E6-$H6 & ")"
J6:J10J6=$H6 & $I6
K6:K10K6=RANK.EQ($F6,$F$6:$F$10) & " (" & $E6-$H6 & ")"
E6:E10E6=RANK.EQ(D6,$D$6:$D$10)


I guess I'll have to calculate the rank in a different column than the rank+delta as in columns J & K.

Any better suggestions?
 
Upvote 0
Starting with your original Example with your replacement formula being in Column H Rank2.
Excel Formula:
        =RANK.EQ([@[5/3]],[5/3]) & " (" & [Rank1]-[Rank2] & ")"
You have a couple of issues.

1) In the formula you are referring to [Rank2], this means the formula is referring to itself, hence the circular reference.
2) As per @6StringJazzer presumably you are going to do the same thing to Rank3 & Rank1 which means that you are trying to deduct a string value. In the case of Rank2, Rank1 will be a string that you are trying to deduct from the Rank2 value.

I believe this means you will need to independently redo all the calculations eg for Rank2
Excel Formula:
=RANK.EQ([@[5/3]],[5/3]) & " (" & RANK.EQ([@[5/1]],[5/1]) -RANK.EQ([@[5/3]],[5/3]) & ")"
Where
Rank2 = RANK.EQ([@[5/3]],[5/3])
Rank1 = RANK.EQ([@[5/1]],[5/1])
 
Upvote 0
I am a bit late I see but with regard to this:
Did you mean I7? That's the cell that contains the formula you mention. The formula in H7 is =RANK.EQ([@[5/3]],[5/3]).
No, I meant H7, per your post:
But when I put this equation in H7
VBA Code:
=RANK.EQ([@[5/3]],[5/3]) & " (" & [Rank1]-[Rank2] & ")"
 
Upvote 0
We have some sort of misunderstanding regarding text vs numbers. I guess I am not explaining it very well. I am not trying to do math on text anywhere is these examples. All the math is in the first table, columns C-K. The second table (M-S) is all text. I created it manually just to show that I wanted the result to look like. There are no formulas in that table. Anyway, that's not important or relevant to the problem.

I do have a circular reference, so I need to find another way. I did a little experimenting with enabling Iterative Calculations, but haven't gotten that to work, either.

Thanks
 
Upvote 0
Hello Jen,
I don't believe I have misunderstood. The reference to text is taking your Rank2 to its logical conclusion which is to replace Rank1 with a combined formula and ther result of that formula is used in the comnbined formula for Rank2. Since the formula involves a string concatentation the Rank1 result is text.
The circular reference is due to Rank2 referring to itself.

See if the below helps.

20220507 Table Formula combining 2 Rank JenniferMurphy v02.xlsx
OPQRS
13DescriptionColumnFormulaResult Data TypeComment
14Original Separate FormulasRank2=RANK.EQ([@[5/3]],[5/3]) Number
15Δ1-2=[@Rank1]-[@Rank2]Number
16
17Combined Formulas
18Jennifer's SampleRank2=RANK.EQ([@[5/3]],[5/3]) & " (" & [Rank1]-[Rank2] & ")"TextCircular Reference. Rank2 is referencing itself
19
20Eliminate reference to selfRank2=RANK.EQ([@[5/3]],[5/3]) & " (" & [Rank1]-RANK.EQ([@[5/3]],[5/3]) & ")"TextThis should work as long as Rank1 is not also changed, since it will be a text concatenation
21
22Modify Above to replace Rank1 cell ref (is text with combined formula)Rank2=RANK.EQ([@[5/3]],[5/3]) & " (" & RANK.EQ([@[5/1]],[5/1]) -RANK.EQ([@[5/3]],[5/3]) & ")"Text
Sheet1
 
Upvote 0
Solution

Forum statistics

Threads
1,215,054
Messages
6,122,895
Members
449,097
Latest member
dbomb1414

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