Anbuselvam
Board Regular
- Joined
- May 10, 2017
- Messages
- 97
Hi
In the below link excel sheet has dropdown list in the cell P1.
In the cell EL1 will shows the results depends on the P1 selection
For that, I used If, sumproduct and index match formulas in the cell EL1 as below.
--
=IF(P1=EN2,(SUMPRODUCT((J8:J30495<=EN1)*(J8:J30495>=EO1)*(G8:G30495="Sales")*CF8:CF30495)),
(IF(P1=EN3,(SUMPRODUCT((J8:J30495<=EN1)*(J8:J30495>=EO1)*(G8:G30495="Sales")*T8:T30495)),
(IF(P1=EN5,SUMPRODUCT((J8:J30495<=EN1)*(J8:J30495>=EO1)*(G8:G30495="Sales")*(BY8:BY30495)),
IF(P1=EN6,(SUMPRODUCT(CG4:EF4,INDEX('RM Price'!$B$2:$BA$239,MATCH('Master Data'!$EN$1,'RM Price'!$A$2:$A$239),))),
(IF(P1=EN7,(SUMPRODUCT((B8:B20496<=EN1)*CE8:CE20496))-(SUMPRODUCT((J8:J20496<=EN1)*BZ8:BZ20496)),
(IF(P1=EN4,(SUMPRODUCT((B8:B20496<=EN1)*CF8:CF20496))-(SUMPRODUCT((J8:J20496<=EN1)*CA8:CA20496)),0))))))))))
--
I would like to convert those formulas with VBA code. Mainly the highlighted with bold formulas I want to write the VBA code.
https://www.dropbox.com/s/zmdi1kd2q0nk0xg/Mr Excel.xlsb?dl=0
I hope someone will help in this regards
Thanks in advance
Sincerely Yours
Anbuselvam K
In the below link excel sheet has dropdown list in the cell P1.
In the cell EL1 will shows the results depends on the P1 selection
For that, I used If, sumproduct and index match formulas in the cell EL1 as below.
--
=IF(P1=EN2,(SUMPRODUCT((J8:J30495<=EN1)*(J8:J30495>=EO1)*(G8:G30495="Sales")*CF8:CF30495)),
(IF(P1=EN3,(SUMPRODUCT((J8:J30495<=EN1)*(J8:J30495>=EO1)*(G8:G30495="Sales")*T8:T30495)),
(IF(P1=EN5,SUMPRODUCT((J8:J30495<=EN1)*(J8:J30495>=EO1)*(G8:G30495="Sales")*(BY8:BY30495)),
IF(P1=EN6,(SUMPRODUCT(CG4:EF4,INDEX('RM Price'!$B$2:$BA$239,MATCH('Master Data'!$EN$1,'RM Price'!$A$2:$A$239),))),
(IF(P1=EN7,(SUMPRODUCT((B8:B20496<=EN1)*CE8:CE20496))-(SUMPRODUCT((J8:J20496<=EN1)*BZ8:BZ20496)),
(IF(P1=EN4,(SUMPRODUCT((B8:B20496<=EN1)*CF8:CF20496))-(SUMPRODUCT((J8:J20496<=EN1)*CA8:CA20496)),0))))))))))
--
I would like to convert those formulas with VBA code. Mainly the highlighted with bold formulas I want to write the VBA code.
https://www.dropbox.com/s/zmdi1kd2q0nk0xg/Mr Excel.xlsb?dl=0
I hope someone will help in this regards
Thanks in advance
Sincerely Yours
Anbuselvam K