Select and automate

Tigerexcel

Active Member
Joined
Mar 6, 2020
Messages
493
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Book1
ABCDEFGHIJKLMNOPQRS
1Low Model Mid Model
2JanFebMarAprMayJunJanFebMarAprMayJun
3Prod A159780742535Prod A606838454569
4Prod B341184525151Prod B606820835941
5Prod C101393225578Prod C959625144449
6Prod D785283577789Prod D313298828896
7
8High Model
9SelectLowJanFebMarAprMayJun
10SelectHighProd A809077729099
11Prod B6810093436490
12Prod C24181005068100
13Prod D645662149536
14
15JanFebMarAprMayJun
16LowHighVarianceLowHighVarianceLowHighVarianceLowHighVarianceLowHighVarianceLowHighVariance
17Prod A
18Prod B
19Prod C
20Prod D
Sheet2
Cell Formulas
RangeFormula
B16,Q16,N16,K16,H16,E16B16=$B$9
C16,R16,O16,L16,I16,F16C16=$B$10
Cells with Data Validation
CellAllowCriteria
B9:B10ListLow,Mid,High


Trying to calculate variances based on different model selections. I am thinking perhaps the CHOOSE function and INDEX/MATCH to lookup the values from whichever models are selected but any combination of functions that work will do, even thought that named ranges might help but couldn't get them to work.
Cell B17 and C17 should return 15 and 80 etc, because the Low Model and High Model have been selected via B9 and B10.
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Myabe like
=IF(B$16="Low",INDEX($B$3:$G$6,MATCH($A17,$A$3:$A$6,0),MATCH($B$15,$B$2:$G$2,0)),IF(B$16="Mid",INDEX($J$3:$O$6,MATCH($A17,$I$3:$I$6,0),MATCH($B$15,$J$2:$O$2,0))))
 
Upvote 0
Thanks Fluff, your formula works with the Low and Mid scenarios but not when the High scenario is chosen, I can add an extra IF statement to get it to work. It's very likely that new scenarios will emerge so I do need some flexibility with my formulae so I'd like to avoid hard-coding the scenarios if possible. I've played around with some other functions and though this probably looks cumbersome and could be improved upon I've come up with this version which uses INDIRECT and named ranges. It's not perfect and does require the months to be listed as headings so they can be referenced in the formulae. Interested in hearing alternative solutions, ultimately I'll go with something that is flexible and as compact as possible. If it helps, I've just upgraded to Office 365.

Dynamic scenario v2.xlsx
ABCDEFGHIJKLMNOPQRS
1Low Model Mid Model
2JanFebMarAprMayJunJanFebMarAprMayJun
3Prod A159780742535Prod A606838454569
4Prod B341184525151Prod B606820835941
5Prod C101393225578Prod C959625144449
6Prod D785283577789Prod D313298828896
7
8High Model
9SelectLowJanFebMarAprMayJun
10SelectHighProd A1009077729099
11Prod B6810093436490
12Prod C24181005068100
13Prod D645662149536
14
15JanJanJanFebFebFebMarMarMarAprAprAprMayMayMayJunJunJun
16LowHighVarianceLowHighVarianceLowHighVarianceLowHighVarianceLowHighVarianceLowHighVariance
17Prod A15100-859790780773747222590-653599-64
18Prod B3468-3411100-898493-9524395164-135190-39
19Prod C1024-141318-593100-72250-285568-1378100-22
20Prod D7864145256-48362215714437795-18893653
Forum
Cell Formulas
RangeFormula
B16,Q16,N16,K16,H16,E16B16=$B$9
C16,R16,O16,L16,I16,F16C16=$B$10
B17:C20,E17:F20,H17:I20,K17:L20,N17:O20,Q17:R20B17=INDEX(INDIRECT(B$16),MATCH($A17,$A$3:$A$6,0)+1,MATCH(B$15,$B$2:$G$2,0)+1)
D17:D20,G17:G20,J17:J20,M17:M20,P17:P20,S17:S20D17=B17-C17
Cells with Data Validation
CellAllowCriteria
B9ListLow,Mid,High
B10ListLow,Mid,High
 
Upvote 0
Glad you sorted it & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,616
Messages
6,125,862
Members
449,266
Latest member
davinroach

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