I'm trying to place objects in a grid pattern but I don't want a regular grid where I set column and row count. Instead of column and row I want to set the column and object count and if the count of objects is greater than the columns then it should automatically create a new row. Like in the picture there is a column count of 4 and object count of 9 when objects are greater than 4 it should place objects on a new row and when greater than 8 place on a new row and this should go on indefinitely. I believe it's possible to make something like this with the Grid geometry node but I don't know how. Maybe if I create a grid and make it 4 columns x 1000 rows and then only fill some of the grid cells based on the object count.
Divide the number of your objects by the number of columns.
Round this value up, then you get the number of rows.
The size of the grid results from the number of columns, rows and the given width of an object.
After you have created your grid, use the node
Instance on Points.
However, pass a selection that contains the number of objects as the highest index.
Sorry, it didn't occur to me until after I made this post that it's actually largely identical to @HarryMcKenzie's.
Here's another technique I came up with to go along with it:
Instead of using a grid as a base here, I just duplicate the given object and move its position with a little logic.