Including If statements in Named Ranges?

clarybelw

New Member
Joined
Jul 20, 2020
Messages
2
Office Version
  1. 2013
Platform
  1. Windows
Hello

I have a datatable with various metrics by month and have dynamic named ranges using index set up so that I can plot graphs/sparklines by selecting a start and end date.

I now want to create sparklines to look at percentage changes of each month compared to the value at the start date. Is there a way of incorporating this formula into the named ranges or do I need to create an extra column for each metric to do this?

Current named range (where start date is in 'Front Page (Sparklines)'!$E$1 and end date is in 'Front Page (Sparklines)'!$E$3):
=INDEX(Understand[Total Active Customers],MATCH('Front Page (Sparklines)'!$E$1,Understand[Dates],0)):INDEX(Understand[Total Active Customers],MATCH('Front Page (Sparklines)'!$E$3,Understand[Dates],0))

Current percentage change formula as a new column in the datatable: =IF('Front Page (Sparklines)'!$E$1=[@Dates],0,IF('Front Page (Sparklines)'!$E$1<[@Dates],[@[Total Active Customers]]/INDEX([Total Active Customers],MATCH('Front Page (Sparklines)'!$E$1,[Dates]))-1,NA()))

Any help much appreciated! Many thanks :)
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
I've now created a named range to calculate the percentages but I still need to be able to restrict on the dates. I've tried a couple of offsets and index-match formulas but can't get it to work!

=IF('Front Page (Sparklines)'!$E$1=Understand[Dates],0,IF('Front Page (Sparklines)'!$E$1<Understand[Dates],Understand[Total Active Customers]/INDEX(Understand[Total Active Customers],MATCH('Front Page (Sparklines)'!$E$1,Understand[Dates]))-1,NA()))
 
Upvote 0

Forum statistics

Threads
1,215,457
Messages
6,124,941
Members
449,197
Latest member
k_bs

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