I have the following problem: I need to sum the values in the three columns "Value", and at the same time calculate the discount rate for all items that are marked with the "YES" flag.
The rule for calculating the discount is as follows: For each item marked, separate the word before the "To" tab and search the "Products" table just below the main table. (See attached picture)
Comments:
If someone can see a way that I have not tried yet and that works, thank you in advance for any help!
Angelino
Try following which would sum adding discount where flag is Yes. You can amend ranges according to number of rows present in sum range and lookup range.
{=SUMPRODUCT(C7:C17*IF($B$7:$B$17="Yes",VLOOKUP(LEFT($A$7:$A$17$,FIND(" ",$A$7:$A$17$)-1),$A$20:$B$22,2,FALSE),1)) + SUMPRODUCT(D7:D17*IF($B$7:$B$17="Yes",VLOOKUP(LEFT($A$7:$A$17$,FIND(" ",$A$7:$A$17$)-1),$A$20:$B$22,2,FALSE),1)) + SUMPRODUCT(E7:E17*IF($B$7:$B$17="Yes",VLOOKUP(LEFT($A$7:$A$17$,FIND(" ",$A$7:$A$17$)-1),$A$20:$B$22,2,FALSE),1))}
使用SUMIF
作为“伪查找”来获取百分比,您可以使用此公式
=SUMPRODUCT(SUMIF(A20:A22,LEFT(A7:A17,FIND(" ",A7:A17)-1),B20:B22)*(B7:B17="Yes")*C7:E17)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.