Somehow I must have created an array, but I don't know where

JenniferMurphy

Well-known Member
Joined
Jul 23, 2011
Messages
2,532
Office Version
  1. 365
Platform
  1. Windows
I have been working on moderately complicated table. When I just now tried to sort it on one of the columns, I got this error:

image.png


I didn't intentionally define or create any arrays and, as far as I can tell, I don't have any array formulas.

Most of the table is data. There are formulas in only 3 columns. Two of them have calls to a UDF and then I find the Min, Max, and Ave of those values.

It looks like the third column may be the culprit, but I don't know why or how. But if I don't include it in the sort, the sort works without the error.

If I select any cell in that column, the entire column gets a kinda shaded border. The formula in each cell is the same:

VBA Code:
=COUNTIF(NameHdr:NameFtr,NameHdr:NameFtr)>1

NameHdr is the cell just above the first cell in the Name column and NameFtr is the cell just below the last cell in the Name column. It displays "TRUE" if the corresponding text in the Name column has a duplicate in that column and "FALSE" otherwise. If I select any cell except the first cell containing that formula, the formula in the formula bar is greyed out and if I click there, is gets cleared.

Does that formula create an implicit array?

If so, is there any way to get around that?

Thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
You've got a function that returns an array and it's spilling automatically down the rows, which is why you can only edit the formula in the first cell. To avoid that you'd need to rewrite it so that it evaluates each row of the range in turn, rather than all at once - e.g. by using an INDEX function around it.
 
Upvote 0
You've got a function that returns an array and it's spilling automatically down the rows, which is why you can only edit the formula in the first cell. To avoid that you'd need to rewrite it so that it evaluates each row of the range in turn, rather than all at once - e.g. by using an INDEX function around it.
I don't understand why it's returning an array or how Index will fix it.

I have a table containing data about members of a club. The first column is the member's name. It's a voluntary list and members sign up and drop off periodically. I wanted to have a way to ne notified if I tried to add a name that was already in the list. The list is not sorted alphabetically, so that formula was what I came up with. I'm sure there is a better way, but that what I was able to think of.
 
Upvote 0
NameHdr:NameFtr is a multi-cell range. Since you are passing that as the criterion, you will get an array of results - the counts for each of those cells.

If you've actually got a Table, I'm not sure why you wouldn't just use something like
Excel Formula:
=COUNTIF([NameColumn],[@NameColumn])>1
which would just evaluate for the relevant row of the table.
 
Upvote 0
Solution
NameHdr:NameFtr is a multi-cell range. Since you are passing that as the criterion, you will get an array of results - the counts for each of those cells.

If you've actually got a Table, I'm not sure why you wouldn't just use something like
Excel Formula:
=COUNTIF([NameColumn],[@NameColumn])>1
which would just evaluate for the relevant row of the table.
Thanks, that helped. I just forgot to make this resolved back then. ?
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,269
Members
449,075
Latest member
staticfluids

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