cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

This operation can only be performed on an array

Dan3
4-Participant

This operation can only be performed on an array

Hi,

 

I have the error 'This operation can only be performed on an array' as on the sheet attached (simplified version of calc sheet). What is the work around?

 

The last part with the error would be part of a larger function, but acts in the same way.

 

Kind regards,

Dan

1 REPLY 1
Werner_E
25-Diamond I
(To:Dan3)

 

You can't use range variables i, j inside a program.
In a program you would have to use for-loops instead.

 

 

See if the calculation I appended at the end does what you intended.

I attached a version how I would do it and another one following the way you had chosen.
I also streamlined your row sum function as it was a bit unclear because of the double usage of the variable "j" and the inefficient and unnecessary inner loop. This function also does not require vectorization.

 

Prime 9 file attached

Announcements

Top Tags