Index/Match to return array constant instead one cell/value

Greentree

New Member
Joined
Sep 21, 2015
Messages
2
Hello Everyone,
I am asking on some topic which is probably not new, so I did some research, yet my problem didnt solve.
Another topic which comes close is this one: http://www.mrexcel.com/forum/excel-questions/496921-return-array-index-match.html
Not sure if this would have to be placed in the trackback field.

I have a data set with quotation data, each on a specific date and I want to do some statistics with it.
For that purpose, I want to dynamically select certain date ranges from/to or other criteria from a source sheet and then feed those via an array constant into another output formula, in as few steps as possible, preferable as 1-step. The goal is to avoid manual steps here. I will apply this to much bigger data sets and query variations.

I am using this input formula at the moment
{=INDEX(Source!$A$2:$A$6;MATCH(1;(Source!$A$2:$A$6>=Forecast!$B$1)*(Source!$A$2:$A$6<=Forecast!$B$2)*(Source!$E$2:$E$6="Won");0))}

Forecast B1 and B2 sets the start and finish date of the query.
When clicking on the fx-button and going into the formula helper, it actually shows the right array constant (dynamic selection) only as a result INDEX picks a single value out of it.

I trying to feed the array constant into a statistical formula such as quartile.inc({=INDEX(Source!$A$2:$A$6;MATCH(1;(Source!$A$2:$A$6>=Forecast!$B$1)*(Source!$A$2:$A$6<=Forecast!$B$2)*(Source!$E$2:$E$6="Won");0))};2)

Ideally it should look like
Forecast!B1= 1-1-2013
Forecast!B2= 1-12-2014

WRONG =quartile.inc (3465;2)
RIGHT=quartile.inc({234,3465,856,345};2)
RIGHT Return Value = 600,5
The problem is that INDEX returns only one cell/value.

Thanks for your help.

Example Source:
ClosedCustomerCountryRevenueStatus
1-7-2013AUSA234Lost
1-6-2014BUK3465Won
20-10-2014CGer856Won
11-12-2014CGer345Lost
3-3-2015AUSA6786Won

<tbody>
</tbody>
 
Last edited:

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Hi

You can just use a single IF() as an array function (control+shift+enter) to return an array based on criteria, and then stick it in whatever formula you like.

Code:
=IF((Source!$A$2:$A$6>=Forecast!$B$1)*(Source!$A$2:$A$6<=Forecast!$B$2)*(Source!$E$2:$E$6="Won"),Source!$D$2:$D$6)

I changed the return to column D as I think you want the Revenue, right? In general:
Code:
=IF((DateRange>StartDate)*(DateRange<=EndDate)*(SourceRange="Won"), RevenueRange)

Hope that helps

Mackers
 
Upvote 0
Hi Mackers,
thank you very much. Its working with IF.
So simple it is! Unbelievable.
We have a saying: You cant see the wood among for all those trees anymore.

Thank you once more.

Mike
 
Upvote 0
Hi

I'm exactly in your camp there - the first thing I was thinking was "maybe I could return the entire row/column by using a 0 as an argument within the INDEX, or doing some kind of array multiplication". Then I took a step back and realised what was going on, hah.

Incidentally I hadn't thought to use your method of multiplying the arrays like you would in a sumproduct - I would've used IF(Array=Thing, IF(Array=Thing, IF(Array=Thing, DesiredArray))) which is less efficient and messier, so thanks.

Mackers
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,173
Members
451,543
Latest member
cesymcox

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