Using a Formula to create a range

Graemea

Board Regular
Joined
Oct 30, 2015
Messages
116
Office Version
  1. 365
Platform
  1. Windows
Hi,


I have sample data arranged as in A1:G11 and would like to create a formula that will use the parameters in cells K1 and K2 to create a range that will be used in a function.


For example, K1 is 28/02/2018 and K2 is Profit so the range that should be returned the formula for use in whatever function I put in cell K3 should be E4:E11.


Can someone please tell me how to create such a range.


Thanks!




Book1
ABCDEFGHIJK
1DATE31/01/201831/01/201828/02/201828/02/201831/03/201831/03/2018DATE28/02/2018
2DATA TYPESalesProfitSalesProfitSalesProfitDATA TYPEProfit
3PRODUCT
4AAA100100100100100100
5BBB100100100100100100
6CCC100100100100100100
7DDD100100100100100100
8EEE100100100100100100
9FFF100100100100100100
10GGG100100100100100100
11HHH100100100100100100
Sheet1
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
You can use index to return a range. For example below the column is summed. Note this would be put into your formula not as a stand alone formulas.


Excel 2010
ABCDEFGHIJK
1DATE1/31/20181/31/20182/28/20182/28/20183/31/20183/31/2018DATE2/28/2018
2DATA TYPESalesProfitSalesProfitSalesProfitDATA TYPEProfit
3PRODUCT1477
4AAA100100100100100100
5BBB100100100100100100
6CCC100100100100100100
7DDD100100100100100100
8EEE100100100100100100
9FFF100100100100100100
10GGG100100100100100100
11HHH100100100777100100
Sheet6
Cell Formulas
RangeFormula
K3{=SUM(INDEX(B4:G11,1,MATCH(K1&K2,B1:G1&B2:G2,0)):INDEX(B4:G11,COUNTA(A4:A11),MATCH(K1&K2,B1:G1&B2:G2,0)))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,427
Messages
6,124,831
Members
449,190
Latest member
rscraig11

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