Understanding a formula with a circular reference

gruntingmonkey

Active Member
Joined
Mar 6, 2008
Messages
444
Office Version
  1. 365
Platform
  1. Windows
Hello again,

I have a formula as below that works out the difference between two scores (1 to 5) which are placed between columns F & O. F being year 2017, g being 2018 etc.

It selects the last two columns and returns an icon of green arrow up, yellow stays the same and red down.

=IF(INDIRECT(SUBSTITUTE(ADDRESS(1,COUNTA(F46:O46)+5,4),"1","")&ROW())>INDIRECT(SUBSTITUTE(ADDRESS(1,COUNTA(F46:O46)+4,4),"1","")&ROW()),100, IF(INDIRECT(SUBSTITUTE(ADDRESS(1,COUNTA(F46:O46)+5,4),"1","")&ROW())=INDIRECT(SUBSTITUTE(ADDRESS(1,COUNTA(F46:O46)+4,4),"1","")&ROW()),50, 0))

I keep getting a circular cell calc error but cant work out where it is. Does anyone have any ideas?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
In order to determine the cause of the circular reference, we need to know which cell that formula was put in.
 
Upvote 0
You have this
INDIRECT(SUBSTITUTE(ADDRESS(1,COUNTA(F46:O46)+5,4),"1","")&ROW())

If the result of COUNTA(F46:O46) happens to be 0, then that translates like this
INDIRECT(SUBSTITUTE(ADDRESS(1,COUNTA(F46:O46)+5,4),"1","")&ROW())
INDIRECT(SUBSTITUTE(ADDRESS(1,0+5,4),"1","")&ROW())
INDIRECT(SUBSTITUTE(ADDRESS(1,5,4),"1","")&ROW())
INDIRECT(SUBSTITUTE("E1","1","")&ROW())
INDIRECT("E"&ROW())
INDIRECT("E"&46)
INDIRECT("E46")
E46 = Circular reference.


Same for the other one that uses +4 instead of +5
ADDRESS(1,COUNTA(F46:O46)+4,4)
If counta = 1, then it still boils down to E46.
 
Upvote 0
Put the formula in a cell that cannot end up being referenced by the formula.
It's all dependent on the result of COUNTA(F46:O46)+5 and +4
It's minimum result is 4, which would be column D
It's maximum result is 15 column O

So the formula should be in columns A B C, or P+
 
Upvote 0
But its impossible for CountA of COUNTA(F46:O46) to be 0.

And I cant change where the cell is located.

I'm now confused as to what the formula does... Although it does bring back the correct answer!
 
Upvote 0
Here's what the formula does.
With the formula in E46
And say the counta = 5 for example (it's only a circular reference if it's 0 or 1)
That whole formula boils down to this (from the counta, address, substitute, row and indirect functions)
=IF(J46>I46,100, IF(J46=I46,50, 0))
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,907
Messages
6,175,301
Members
452,633
Latest member
DougMo

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