Calculation The GAP

apramono

New Member
Joined
Jun 14, 2013
Messages
9
Office Version
  1. 365
Platform
  1. Windows
Hi All,

Please kindly help for the problem. I need to break down and compare data for scan vs data sales.
1. If the data scan > data sales . The calculation will be using data sales
2. If the data scan < data sales . The calculation will be using data scan

Unfortunately data scan separate amount how much

CodeName500400300200100Total ScanData SalesCalculation
abcMr. X1000565=(1*500)+(4*100)
defMr. Y0221056=(2*400)+(2*300)+(1*200)
 
Because i will used the lowest number ... total scan 6 and data sales are 5

Store Name10,000,0005,000,0001,000,000500,000100,00050,00020,00010,0005,000Grand TotalData SalesCalculation
TOMS LIGHTING-------15-155= (5*5000)
TOMS LIGHTING 2------19-1010=(1*20.000)+(9*10.000)
CAHAYA AGUNG JAYA ELEKTRIK-------46-4630=(30*10.000) caused data sales are 30
Purnama jaya elektrik-------2-2-0 cause data sales are 0
DUA BERLIAN TK---111---36=(1*500.000)+(1*100.000)+(1*50.000)
UD PIJAR MANDIRI-------11-1111=(11*10.000)
RADO/SURYA ELEKTRIK--1--5281478-765325=(1*1.000.000)+(5*50.000)+(281*20.000)+(38*10.000) (the rest will not calculate because data sales are 325)
I'm assuming the table above Store Name is in cell A1. The formula for Toms Lighting would be:
Excel Formula:
=IF(L2<=K2,SUMPRODUCT($B$1:$J$1,B2:J2,1*(B2:J2<L2))+SUMPRODUCT($B$1:$J$1,(B2:J2>L2)*(L2-SUMIF(B2:J2,"<"&L2))),SUMPRODUCT($B$1:$J$1,B2:J2))

You can then drag the formula down
 
Upvote 0

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
I'm assuming the table above Store Name is in cell A1. The formula for Toms Lighting would be:
Excel Formula:
=IF(L2<=K2,SUMPRODUCT($B$1:$J$1,B2:J2,1*(B2:J2<L2))+SUMPRODUCT($B$1:$J$1,(B2:J2>L2)*(L2-SUMIF(B2:J2,"<"&L2))),SUMPRODUCT($B$1:$J$1,B2:J2))

You can then drag the formula down
Hi Zot, Thanks a alot for the feedback. I'll try to implement the formula into my workbook. But some calculation are still in correct.

ArcodeStore Name10,000,0005,000,0001,000,000500,000100,00050,00020,00010,0005,000Grand TotalBenefit Serbu Vers.Data SalesEntitlement
1​
ABC-------15-15150,00010100,000
2​
DEF------19-10110,000--
3​
GHI-------46-46460,00030300,000
4​
JKL-------2-220,000--
5​
MNO-------9-990,0001390,000
6​
PWR-------11-11110,000--
7​
STU--1--5281478-76511,650,00049411,650,000
8​
VWX-------22-22220,000113220,000
9​
YZA-------1-110,000410,000
10​
ABD--2-3780792944-1,85534,980,0005,20534,980,000
11​
ALS-------1-110,000310,000
12​
ATU-------4-440,000640,000

For row number 7 it number of entitle are : 8.940.000
Total Data Scan are : 765
Total Data Sales : 494

It was come from
Data ScanShould EntitleEntitle Based ScanEntitle Final
1​
1​
1,000,0001,000,0001,000,000
5​
5​
50,000250,000250,000
281​
281​
20,0005,620,0005,620,000
478​
207​
10,0004,780,0002,070,000
765​
494​
11,650,0008,940,000

Only 207*10.000 data from 478 data scan

Thanks in advance Zot.
 
Upvote 0
I probably copy wrong one. The one I tested OK was without =. L2<K2 instead of L2<=K2
Tested this just fine with data row#7

Excel Formula:
=IF(L2<K2,SUMPRODUCT($B$1:$J$1,B2:J2,1*(B2:J2<L2))+SUMPRODUCT($B$1:$J$1,(B2:J2>L2)*(L2-SUMIF(B2:J2,"<"&L2))),SUMPRODUCT($B$1:$J$1,B2:J2))

Get 8,940,000 as answer.
 
Upvote 0

Forum statistics

Threads
1,215,234
Messages
6,123,773
Members
449,123
Latest member
StorageQueen24

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