Find Conditional Percentage of sum of multiple cells

SAJIL RAHMAN

New Member
Joined
Mar 30, 2018
Messages
5
TYPE1TYPE2TOTAL1TOTAL2PERCENTAGE
EBT5000050000I NEED TO CALCULATE 3% OF SUM TOTAL1 &2 IF TYPE 1 IS "E/F/O" AND TYPE2 IS "DT"... IT SHOULD BE 5% IF TYPE1 IS "E" AND TYPE2 IS "BT"
EDT5000050000
FDT15000050000
ODT25000050000

<tbody>
</tbody>

Please help me to find the suitable formula, i tried my best last 2 days....:(
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Assuming your data starts in A1, replace E2 with this formula and drag it down with the fill handle.

=IF(AND(A2="E",B2="BT"),SUM(C2:D2)*5%,SUM(C2:D2)*3%)

Does that work?
 
Upvote 0
Assuming your data starts in A1, replace E2 with this formula and drag it down with the fill handle.

=IF(AND(A2="E",B2="BT"),SUM(C2:D2)*5%,SUM(C2:D2)*3%)

Does that work?

Aladin, doing some "backwards" logic, since his criteria is simpler in his 2nd criteria example... But i love your formula's idea though :)
 
Upvote 0
Aladin, doing some "backwards" logic, since his criteria is simpler in his 2nd criteria example... But i love your formula's idea though :)

Aladin's formula is good to confuse my friends, whereas Dave's is good to teach my friends...anyway many thanks for the great answers.
 
Upvote 0
Aladin's formula is good to confuse my friends, whereas Dave's is good to teach my friends...anyway many thanks for the great answers.

Row\Col
A​
B​
C​
D​
E​
F​
G​
H​
I​
1​
TYPE1TYPE2TOTAL1TOTAL2PERCENTAGEbtdt
2​
EBT
50000
50000
5000
e
5%​
3%​
3​
EDT
50000
50000
3000
o
3%​
4​
FDT
150000
50000
6000
f
3%​
5​
ODT
250000
50000
9000

In E2 enter and copy down:

Either [1]...

=SUM(C2:D2)*INDEX($H$2:$I$4,MATCH(A2,$G$2:$G$4,0),MATCH(B2,$H$1:$I$1,0))

Or [2]...

=SUM(C2:D2)*VLOOKUP(A2,$G$1:$I$4,MATCH(B2,$G$1:$I$1,0),0)

Or [3], apply F9 to the ranges of the INDEX bit in [1], and apply the result in E2 downwards...

=SUM(C2:D2)*INDEX({0.05,0.03;0,0.03;0,0.03},MATCH(A2,{"e";"o";"f"},0),MATCH(B2,{"bt","dt"},0))

Or [4], apply F9 to the ranges of the VLOOKUP bit in [2], and apply the result in E2 downwards...

=SUM(C2:D2)*VLOOKUP(A2,{0,"bt","dt";"e",0.05,0.03;"o",0,0.03;"f",0,0.03},MATCH(B2,${0,"bt","dt"},0),0)

I posted [3] for you as one that you could invoke (and confuse your friends).




It's thus your lookup table that you see in-lined in the formula...
 
Upvote 0
Number [4] has a typo. Corrected for that...

=SUM(C2:D2)*VLOOKUP(A2,{0,"bt","dt";"e",0.05,0.03;"o",0,0.03;"f",0,0.03},MATCH(B2,{0,"bt","dt"},0),0)
 
Upvote 0
My (our?) pleasure. Glad that you got your answer

Both has given my answer, while i have chosen your formula because it helps me to make some changes and to give more additional options.
Could you please help me that i need to ROUND the answer, i tried to change the formula but failed, please provide me the same above formula with Rounding facility. (>.5 to 1/ <.5 to 0)
 
Upvote 0
row\col
a​
b​
c​
d​
e​
f​
g​
h​
i​
1​
type1type2total1total2percentagebtdt
2​
ebt
50000
50000
5000
e
5%​
3%​
3​
edt
50000
50000
3000
o
3%​
4​
fdt
150000
50000
6000
f
3%​
5​
odt
250000
50000
9000

<tbody>
</tbody>


in e2 enter and copy down:

Either [1]...

=sum(c2:d2)*index($h$2:$i$4,match(a2,$g$2:$g$4,0),match(b2,$h$1:$i$1,0))

or [2]...

=sum(c2:d2)*vlookup(a2,$g$1:$i$4,match(b2,$g$1:$i$1,0),0)

or [3], apply f9 to the ranges of the index bit in [1], and apply the result in e2 downwards...

=sum(c2:d2)*index({0.05,0.03;0,0.03;0,0.03},match(a2,{"e";"o";"f"},0),match(b2,{"bt","dt"},0))

or [4], apply f9 to the ranges of the vlookup bit in [2], and apply the result in e2 downwards...

=sum(c2:d2)*vlookup(a2,{0,"bt","dt";"e",0.05,0.03;"o",0,0.03;"f",0,0.03},match(b2,${0,"bt","dt"},0),0)

i posted [3] for you as one that you could invoke (and confuse your friends).




It's thus your lookup table that you see in-lined in the formula...


never knew that there are too many ways to get my answer....:)
thanks a lot got many things to learn....
 
Upvote 0

Forum statistics

Threads
1,215,420
Messages
6,124,803
Members
449,190
Latest member
cindykay

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