• 469K Members
• 4,655 Online
• 567K Conversations
SOLVED

New Contributor

# Index and match 2 values to then create a percentage

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
Solution

# Re: Index and match 2 values to then create a percentage

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

# Re: Index and match 2 values to then create a percentage

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```

# Re: Index and match 2 values to then create a percentage

Thank you so much! this worked a treat!

Cheers

Joel

Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies