countif and sumproduct (i think)

jj_martin_87

New Member
Joined
Jan 20, 2017
Messages
8
[FONT=&quot]I have an excel sheet with a column of dropdowns for different values. If the value is “apples” I want it to multiply the value by 4%. if there is a cell in the column where apples is chosen, i need it to multiply by 5%. A third 6%. Right now i have two formulas in place

=iferror(if(E21="apples",K21*vlookup($Q$2,$O$2:$P$4,2,false),P21*vlookup(E21,$J$2:$K$14,2,false)),"")

=countif(E21:E37,"apples")

This table represents O1:Q4

<style type="text/css"><!--td {border: 1px solid #ccc;}br {mso-data-placement:same-cell;}--></style>
[/FONT]

apples countratecurrent apples count
14.00%1
25.00%
36.00%

<colgroup><col style="width: 100px"><col width="85"><col width="100"></colgroup><tbody>
</tbody>
[FONT=&quot] [/FONT]
 
In C2 enter and copy down:

=VLOOKUP(COUNTIFS($A$2:$A2,$A2),$E$2:$F$4,2,0)*$B2

If testing for apples is necessary...

In C2 enter and copy down:

=IF($A2="apples",VLOOKUP(COUNTIFS($A$2:A2,A2),$E$2:$F$4,2,0)*$B2,"")
 
Upvote 0

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,215,460
Messages
6,124,949
Members
449,198
Latest member
MhammadishaqKhan

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