Little help with functions

SanchoP

New Member
Joined
Feb 7, 2014
Messages
9
Hello everyone,

I have a problem with build a function from many if, sums and count

ABCD
NameCategoryPositive / NegativeNumber
AAxPositive
103 503 253,74</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
BBxNegative
42 125 221,42</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
CCyPositive
85 401 512,22</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
DDzPositive
30 600 783,38</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
EEyNegative
32 698 328,06</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
FFyPositive
36 048 545,10</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
GGyPositive
993 354,51</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
HHxNegative
774 600,81</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
IIzPositive
10 420 490,23</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
JJzPositive
23 557 656,72</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
KKxNegative
1 141 258,86</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
LLzPositive
1 162 261,71</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
MMxPositive
1 170 530,17</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
NNyNegative
92 860 585,07</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
sum
462 458 382,00</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>

<TBODY>
</TBODY>





























I would like to build a function counting quantity (countif/countifs) of "name" for each category, only "positive" which sum ( each category ) will be over 80%

E.g.

Category X = 1

Because

=sumifs($D$4:$D$17;$B$4:$B$17;B20;$C$4:$C$17;$C$4) => category "X" and "Positive"

104673783,91 * 0,8 = 83739027,128

and

103 503 253,74</SPAN> > 83739027,128

so only 1 name gave over 80%


X1
Y
Z

<TBODY>
</TBODY>

Many thanks in advance!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
try this one


Excel 2012
ABCD
1NameCategoryPositive / NegativeNumber
2AAxPositive103503253.7
3BBxNegative42125221.42
4CCyPositive85401512.22
5DDzPositive30600783.38
6EEyNegative32698328.06
7FFyPositive36048545.1
8GGyPositive993354.51
9HHxNegative774600.81
10IIzPositive10420490.23
11JJzPositive23557656.72
12KKxNegative1141258.86
13LLzPositive1162261.71
14MMxPositive1170530.17
15NNyNegative92860585.07
16
17
18Positive
19x1.00
20y0.00
21z0.00
Sheet2
Cell Formulas
RangeFormula
B19=SUMPRODUCT(($D$2:$D$15>SUMIFS($D$2:$D$15,$B$2:$B$15,$A19,$C$2:$C$15,B$18)*0.8)*($B$2:$B$15=$A19)*($C$2:$C$15=$B$18))
B20=SUMPRODUCT(($D$2:$D$15>SUMIFS($D$2:$D$15,$B$2:$B$15,$A20,$C$2:$C$15,B$18)*0.8)*($B$2:$B$15=$A20)*($C$2:$C$15=$B$18))
B21=SUMPRODUCT(($D$2:$D$15>SUMIFS($D$2:$D$15,$B$2:$B$15,$A21,$C$2:$C$15,B$18)*0.8)*($B$2:$B$15=$A21)*($C$2:$C$15=$B$18))
 
Upvote 0
Thank you for your reply however it is not enought for me .
Your counting gives in y 0 and z also 0

I will need to get y = 2 because CC ( Positive and the highest in category y- 85401512.22 ) and FF ( also positive and 2end highest in category y - 36048545.1 ) . Sum of CC and FF = 121450057,32 . This is bigger then sum of y category * 0,8

121450057,32 > 97954729,464 ( 122443411,83*0,8 )

x1AA
y2CC,FF
z2DD,JJ

<COLGROUP><COL style="WIDTH: 48pt" span=3 width=64><TBODY>
</TBODY>
 
Upvote 0
EDIT: ok let me correct it, as I check each value separately and not the sum
 
Last edited:
Upvote 0
Ok don't understand example from post#1 then

Category X = 1

Because

=sumifs($D$4:$D$17;$B$4:$B$17;B20;$C$4:$C$17;$C$4) => category "X" and "Positive"

104673783,91 * 0,8 = 83739027,128

and

103 503 253,74 > 83739027,128

so only 1 name gave over 80%

you check the 80% of sum of all Positive X
but then why you count only first value against this 80%.

based on this example formula works correct as each of numbers for all Positive Z and Y are less than 80% of category sum



Excel 2012
ABCD
1NameCategoryPositive / NegativeNumber
4CCyPositive85401512.22
7FFyPositive36048545.1
8GGyPositive993354.51
16
17
18Positive
19x83739027.11
20y97954729.460
21z52592953.630
Sheet4




Excel 2012
ABCD
1NameCategoryPositive / NegativeNumber
5DDzPositive30600783.38
10IIzPositive10420490.23
11JJzPositive23557656.72
13LLzPositive1162261.71
16
17
18Positive
19x83739027.11
20y97954729.460
21z52592953.630
Sheet4
 
Last edited:
Upvote 0
Sorry for misguide you in post 1

The formula is working correct
based on this example formula works correct as each of numbers for all Positive Z and Y are less than 80% of category sum

but I want a formula counting sum of Positive X ( this is a basic sum ) and multiplay by 0,8 will give a 80% of Positive and X.
Than I need to find how many the highest names are more then basic sum*0,8

E.g.

Y=2 ( CC and FF )
CC ( Positive and the highest in category y- 85401512.22 ) and FF ( also positive and 2end highest in category y - 36048545.1 ) . Sum of CC and FF = 121450057,32 . This is bigger then sum of y category * 0,8

121450057,32 (121450057,32=85401512,22+36048545,1) > 97954729,464 ( 122443411,83*0,8 )


Reasuming I need a sum more then 80% not a less than 80%.


Realy appriciate your help

Thank YOU !
 
Upvote 0
So let me check if I understood you correctly.

You actually don't need to check how many numbers in particular category are greater than 80% of it sum.
What you need is to check how many numbers need to be added so the sum will greater than 80% of the category sum.
 
Upvote 0
What you need is to check how many numbers need to be added so the sum will greater than 80% of the category sum.

Yes , exactly

but those numbers need to be the highest ( also positive and in each category )
 
Upvote 0
Hmm this is not so "little";)

To be honest I am not sure how to make formula to do what you requested. Will try of course but no promises (I can do this with VBA though). Maybe some one more experienced will able to help.
 
Upvote 0

Forum statistics

Threads
1,215,575
Messages
6,125,616
Members
449,238
Latest member
wcbyers

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