SOLVED

Index and match 2 values to then create a percentage

Copper Contributor

Hi all,

I am looking to make a table of stock market index performance for various time ranges.

I have tried using the index and match function but not sure how to incorporate that into a wider capture all function.

Effectively, i want to do 2 index and match functions then do some simple maths on those 2 results.

Formula looks as follows: =INDEX('Index Raw Data'!C4:C59,MATCH(Sheet1!I2,'Index Raw Data'!B4:B59,0)) minus this function =INDEX('Index Raw Data'!C5:C60,MATCH(Sheet1!I3,'Index Raw Data'!B5:B60,0)) divided by the result of the second function to get the percentage change.

Sample workbook attached using cells I2 and I3 as example date ranges for the index and match function.

The information is pulled from the "index Raw Data" tab.

Thanks
Joel

3 Replies
best response confirmed by Caesarus7 (Copper Contributor)
Solution
Hi

Try this

=1- ( INDEX('Index Raw Data'!C5:C60,MATCH(I3,'Index Raw Data'!B5:B60,0)) / INDEX('Index Raw Data'!C4:C59,MATCH(I2,'Index Raw Data'!B4:B59,0)) )

Or to make it bit more flexible

=INDEX(
   OFFSET('Index Raw Data'!$A$1,3,
      MATCH($A4,'Index Raw Data'!$1:$1,0)+(MATCH($A4,'Index Raw Data'!$1:$1,0)>2),
      COUNTA('Index Raw Data'!$B:$B)),
   MATCH(I$2,
      OFFSET('Index Raw Data'!$A$1,3,
         MATCH($A4,'Index Raw Data'!$1:$1,0)-(MATCH($A4,'Index Raw Data'!$1:$1,0)=2),
         COUNTA('Index Raw Data'!$B:$B)),0)) /
 INDEX(
   OFFSET('Index Raw Data'!$A$1,3,
      MATCH($A4,'Index Raw Data'!$1:$1,0)+(MATCH($A4,'Index Raw Data'!$1:$1,0)>2),
         COUNTA('Index Raw Data'!$B:$B)),
      MATCH(I$3,
         OFFSET('Index Raw Data'!$A$1,3,
            MATCH($A4,'Index Raw Data'!$1:$1,0)-(MATCH($A4,'Index Raw Data'!$1:$1,0)=2),
            COUNTA('Index Raw Data'!$B:$B)),0))
  -1

 

Thank you so much! this worked a treat!

 

Cheers

Joel 

1 best response

Accepted Solutions
best response confirmed by Caesarus7 (Copper Contributor)
Solution
Hi

Try this

=1- ( INDEX('Index Raw Data'!C5:C60,MATCH(I3,'Index Raw Data'!B5:B60,0)) / INDEX('Index Raw Data'!C4:C59,MATCH(I2,'Index Raw Data'!B4:B59,0)) )

View solution in original post