Array/Index Formula result always 0

iainmartin100

New Member
Joined
Mar 9, 2011
Messages
43
Hi,
I have a 25mb spreadsheet which runs quickly and without fault (the bulk of the spreadsheet in Macro text).

I'm running a Macro which inserts an array/index formula into the spreadsheet (eg formula below), this is runs perfectly and gives the desired result when running all months of the year until I hit December when the result always comes back as "0", I have checked the source document and there is data with a value.

My first assumption is that either Array or Index has hit an excel limit, although I would expect to get a #Val or simular but because I get a 0 value it would suggest that may not be the case?

Can anyone see any errors or limits I have hit, plus any suggestions of how to over come this?

Thanks for looking

Sub Formula_FOC_12()
Dim wb As Variant
Dim wb2 As Variant
Dim WW As Variant
Dim wbN As String

wb = ActiveWorkbook.Name
WW = ThisWorkbook.LinkSources(xlExcelLinks)
wbN = Right(WW(1), Len(WW(1)) - InStrRev(WW(1), "\"))

Range("h400").FormulaArray = "=INDEX('[" & wbN & "]MS Groups'!r4678c6:r5857c6,MATCH(r7c8&r400c3,'[" & wbN & "]MS Groups'!r4678c3:r5857c3&'[" & wbN & "]MS Groups'!r4678c4:r5857c4))"
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Maybe you need to add a FALSE argument to MATCH. If that still doesn't work please post some sample data with the expected result.
 

iainmartin100

New Member
Joined
Mar 9, 2011
Messages
43
Hi, thanks for the reply.

I use identical formula's which work 100%, the only variable is the range im using. The range is looking at an external document r4678c6:r5857c6, would this cause any issues because of the row number?

Many thanks
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
You problem isn't caused by the row numbers. Did you try adding a FALSE argument? Your formula currently assumes that your data is sorted ascending. As I said before post some sample data if it still doesn't work.
 

iainmartin100

New Member
Joined
Mar 9, 2011
Messages
43
Sorry im a bit of a beginner using match & Array, is there any chance you can point me where I should try and add the FALSE into this as I keep making errors?

Range("h400").FormulaArray = "=INDEX('[" & wbN & "]MS Groups'!r4678c6:r5857c6,MATCH(r7c8&r400c3,'[" & wbN & "]MS Groups'!r4678c3:r5857c3&'[" & wbN & "]MS Groups'!r4678c4:r5857c4))"

Many thanks for your help
 

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Like this:

Rich (BB code):
Range("h400").FormulaArray = "=INDEX('[" & wbN & "]MS Groups'!r4678c6:r5857c6,MATCH(r7c8&r400c3,'[" & wbN & "]MS Groups'!r4678c3:r5857c3&'[" & wbN & "]MS Groups'!r4678c4:r5857c4,FALSE))"
 

Forum statistics

Threads
1,082,334
Messages
5,364,681
Members
400,810
Latest member
elbashka

Some videos you may like

This Week's Hot Topics

  • populate from drop list with multiple tables
    Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
  • Find list of words from sheet2 in sheet1 before a comma and extract text vba
    Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
  • Dynamic Formula entry - VBA code sought
    Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...
  • Listbox Header
    Have a named range called "AccidentsHeader" Within my code I have: [CODE]Private Sub CommandButton1_Click() ListBox1.RowSource =...
  • Complex Heat Map using conditional formatting
    Good day excel world. I have a concern. Below link have a list of countries that carries each country unique data. [URL...
  • Conditional formatting
    Hi good morning, hope you can help me please, I have cells P4:P54 and if this cell is equal to 1 then i want row O to say "Fully Utilised" and to...
Top