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))"
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
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.
 
Upvote 0
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
 
Upvote 0
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.
 
Upvote 0
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
 
Upvote 0
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))"
 
Upvote 0

Forum statistics

Threads
1,214,792
Messages
6,121,612
Members
449,038
Latest member
apwr

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