问题
I am using the excel tools OFFSET
and INDEX
to import an array from a different sheet, into a workbook with room for 7 entries. The sheet that is being referenced has an ID number and the number could be listed several times for different entries. If you are not familiar with the offset function, the second to last input is how many rows you want returned in the array. The number I have here is a COUNTIF
for how many times an ID appears.
My code works, however because it is in an array format, this code was implemented for the 7 entries and not all IDs have 7 entries (it varies for each ID). So for the IDs with less than 7 entries #N/A
appears. I thought this would be a simple fix to replace the error with a blank cell, but I've tried using IFERROR
, ISNA
, and other methods but nothing has worked.
This is my raw array code without any if statements.
=OFFSET(INDEX(Compliance,MATCH(CONCATENATE(ID,"*"),Compliance,0)),0,1,COUNTIF(Compliance,CONCATENATE(ID,"*")),2)
Compliance is a certain column within the sheet that I am indexing on and ID is the different ID numbers that I was referring to.
来源:https://stackoverflow.com/questions/31855683/array-returning-n-a-for-some-elements-want-blank