Formula HELP!!?

ChrisK1994

New Member
Joined
Aug 20, 2019
Messages
2
[TABLE="width: 500"]
<tbody>[TR]
[TD]remaining Old Contract Credits[/TD]
[TD]10[/TD]
[TD]Price[/TD]
[TD]30[/TD]
[/TR]
[TR]
[TD]New Contract Credits[/TD]
[TD]50[/TD]
[TD]Price[/TD]
[TD]25[/TD]
[/TR]
[TR]
[TD]Out of contract (no credits)[/TD]
[TD][/TD]
[TD]Price[/TD]
[TD]35[/TD]
[/TR]
[TR]
[TD]Remaining Credits[/TD]
[TD]60[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Order[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]order 1 number of books[/TD]
[TD]order 2 number of books[/TD]
[TD]order 3 number of books[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Book 1[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]book 2[/TD]
[TD]3[/TD]
[TD]40[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]book 3[/TD]
[TD]4[/TD]
[TD]10[/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]invoice[/TD]
[TD]Formula needed[/TD]
[TD]Formula needed[/TD]
[TD]Formula needed[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

so for example here we have 3 books we sell customers agree an annual amount of books they will buy (credits) upfront with contracts and get invoiced instantly £10 per credit ordered in that contract. the remaining cost is invoiced per order.

in this example a customer has 10 credits left on his old contract. his old contract was £30 per book. he has now signed a new contract for 50 more credits at £25. (any orders with no credits left is £35)

now i have a table showing 3 separate orders what formula can i use to invoice each order correctly using the price for the remaining credits first and then using the new contract price after that and if no credits left charging the out of contract price.

i tried an IF formula so if Remaining credits is greater than new contract credits then charge old price - 10 (-10 as they pay £10 up front when signing contract) if remaining credits is less than or equal to the new contract credits then charge the new contract price and if remaining credits is less than or equal to 0 charge out of contract price.

but if one order contained both pricing it couldn't work it out so in the example order 2 should take into account all 3 pricing
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Forum statistics

Threads
1,224,821
Messages
6,181,163
Members
453,021
Latest member
Justyna P

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