Confused On Circular Reference

valleyHemenway

New Member
Joined
Nov 17, 2022
Messages
11
Office Version
  1. 365
Platform
  1. MacOS
Hello,
My goal is to write a formula I can use in a table that creates an "ID" number sequence down the table. I skip some rows depending on values in other columns. So the first row will always have ID 1 and then it might be a few rows before I would expect ID 2 to show up and then eventually 3 and so on.

I do not want to use any specific references (A3). I have what seems to to be a workable formula, but it also acts like there is a circular reference. I have to click into any cell and press ENTER or press F9 before the values change to what they are supposed to be. There is no circular reference error in Excel, and I don't see how my formula creates one. I am stumped.

Does anyone know if I am actually creating a circular reference? Can anyone come up with a different way of creating my "auto-numbering" feature?

Thanks so much!

test.xlsx
CDEFG
3
4Column1Column2Column3
510
6 A
7 B
8 C
910
10 A
11 B
1210
13 A
1410
1510
1610
17 A
18 B
1910
2010
21 A
2210
23 A
24 B
25
Sheet1
Cell Formulas
RangeFormula
D5:D24D5=IF(ISTEXT([@Column2]), "", MAX(INDIRECT(ADDRESS(ROW(Table1[#Headers]),COLUMN([Column1])) & ":" & ADDRESS(ROW()-1,COLUMN([Column1]))))+1)
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Would this work for you ?
In D5
Excel Formula:
=IF(ISTEXT([@Column2]), "", MAX(D$4:D4)+1)
 
Upvote 0
Does that matter ? If you move the table the reference will move as well. What is the downside ?
 
Upvote 0
I am working on this project with a couple people and that was part of the criteria I was given. I can certainly ask, but it might not be something I will get a quick answer on. What I don't understand is why it is acting like a circular reference. I am essentially doing what you are doing, just with ADDRESS and INDIRECT, correct?
 
Upvote 0
I am not sure why it is behaving like a circular reference. The below is probably a more direct way of doing what you are doing:
Excel Formula:
=IF(ISTEXT([@Column2]), "", MAX(Table1[[#Headers],[Column1]]:OFFSET([@Column1],-1,0))+1)
I personally try to avoid INDIRECT and OFFSET wherever possible.
 
Upvote 0
Solution
I just remembered to test for inserting and deleting rows, using D4 will break while offset will keep working
 
Upvote 0
Thank you for the suggestion! I think using OFFSET will work. I am frustrated by why the other method isn't working, but sometimes you just go with what works ;)

Thanks for the assistance!
 
Upvote 0
I am not experiencing the issue you are having with your initial formula. Are you sure calculations are set to automatic and that you don't have any change events running ?
 
Upvote 0
Yes, they are set to automatic. I have a large spreadsheet this is happening on. When I built this sample spreadsheet on a different computer the problem came over with it. The issue I have is when I first open the sample spreadsheet, all of the ID columns have a value of 1 until I either press F9 or go into any cell and then press enter. Then the ID's show up properly. Are you saying that when you build this spreadsheet, save, close, and re-open, the ID values are not all 1?
 
Upvote 0

Forum statistics

Threads
1,216,105
Messages
6,128,859
Members
449,472
Latest member
ebc9

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