Long array formula

drag1c

Board Regular
Joined
Aug 7, 2019
Messages
92
Office Version
  1. 2016
  2. 2013
Platform
  1. Windows
Hi,

I am trying to create .arrayformula from this:
Code:
Sheets("Procurement report").Range("AC19").FormulaArray = "=IFERROR(INDEX(CommentsTable[Comment]:CommentsTable[Comment],MATCH(1,(CommentsTable[Purchase Requisition]:CommentsTable[Purchase Requisition]=B19)*(CommentsTable[Item of requisition]:CommentsTable[Item of requisition]=C19),0)),"""")"

I've did this:
Code:
longformula1 = "=IFERROR(INDEX(XXX:XXX,MATCH(1,(CommentsTable[Purchase Requisition]:CommentsTable[Purchase Requisition]=B19)*(AAA:AAA=C19),0)),"""")"
    longformula3 = "CommentsTable[Item of requisition]:CommentsTable[Item of requisition]"
    longformula2 = "CommentsTable[Comment]:CommentsTable[Comment]"
    
    With Sheet1.Range("AC19")
    
    .FormulaArray = longformula1
    .Replace "XXX:XXX", longformula2
    .Replace "AAA:AAA", longformula3
    
    End With

But it doesn't work.
Could anyone check?

P.S. My formula has total 235 chars. I don't understand why it doesn't work. Could it be written shorter?
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
How about
VBA Code:
Sheets("Procurement report").Range("AC19").FormulaArray = "=IFERROR(INDEX(CommentsTable[Comment],MATCH(1,(CommentsTable[Purchase Requisition]=B19)*(CommentsTable[Item of requisition]=C19),0)),"""")"
 
Upvote 1
Solution
1676378843588.png

1676378969528.png
 
Upvote 0
Sorry for double post. I've solved it.
Table from which data was pulled did not have the same name of header.
Your solution works.

Could you just explain me difference if no problem?
 
Upvote 0
Check that the table & column names are correct.
 
Upvote 0
Fluff actually there is a problem, data is not listed correct with this formula.
1676379308821.png

1676379320929.png
 
Upvote 0
If the formula is not doing what you want, then that is a totally different question & needs a new thread.
 
Upvote 0
Fluff, it works. There is just mess with data from database. In my example there is no unique ID, therefore data is wrong :)

Thank you for help !
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 1

Forum statistics

Threads
1,214,979
Messages
6,122,551
Members
449,088
Latest member
davidcom

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