Allocating cost based on balance on PO line

fayo2009

New Member
Joined
Apr 10, 2017
Messages
27
Office Version
  1. 365
Platform
  1. Windows
Good morning

I am looking for a formula that I can incorporate into an xlookup that will allocate the invoice value up to the value on the first PO line 1 before it uses the value in PO line 2. the xlookup is currently set to select the latest PO line number.



Invoice lineNet amount
12320,000.00
124506.50
125243.42
126189.77
127435.54
1285,000.00
12955.71
130350.28
13122,000.00
1326.34
1330.05
134411.35
135174.05
136605.78
1371,063.53
13855.69
139200.54
1400.68
14176.91
PO NumberPO LinePO Value
345678150,000.00
3456782600,000.00
 
Try placing the following formulas in cells C2 and D2, respectively, and drag-copying them down as needed:
Excel Formula:
=INDEX($A$26:$A$27,MATCH(TRUE,$C$26:$C$27-SUMIFS($B$1:$B1,$C$1:$C1,$A$26:$A$27,$D$1:$D1,$B$26:$B$27)>=B2,0))
=INDEX($B$26:$B$27,MATCH(TRUE,$C$26:$C$27-SUMIFS($B$1:$B1,$C$1:$C1,$A$26:$A$27,$D$1:$D1,$B$26:$B$27)>=B2,0))
Many Thanks, It didnt work.
 
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Could you please elaborate on what exactly "didn't work"? -- In my test file, the formulas produced the desired results for the dataset from Post #3.
 
Upvote 0
I just noticed that you already have a formula for Allocated PO Number. So, here is an updated formula for mapping PO Line to the Invoice Line (cell D2):
Excel Formula:
=INDEX($B$26:$B$33,MATCH(1,($C$26:$C$33-SUMIFS($B$1:$B1,$C$1:$C1,$A$26:$A$33,$D$1:$D1,$B$26:$B$33)>=B2)*($A$26:$A$33=C2),0))
 
Upvote 0

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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