Testing if a condition = TRUE

Lestat

New Member
Joined
Mar 24, 2015
Messages
36
This has to be ridiculously easy, but my brain can't follow it for some reason.

Column E are entries consisting of both positive and negative numbers. Column G is a running total of column E. Column J needs to be 1/2 of the column E entry, but ONLY if both column E AND column G are positive, AND only up to the difference that Column G is positive. For example:


Entry in E3 is -191. Then column G is -191 and column J is 0.

Entry in E4 is 2520. Then column G should be 2329 (a simple running total of G3+E4). But column J should be 1164.50 (the sum of (2520-191) divided by 2).

I tried this formula in column J: =IF((AND(G4>=0,E4>=0)),E4/2,0). However, this is obviously incorrect, because it's returning 1260, instead of 1164.50.

This formula seems to work: =IF(G3+G4>=0,(G3+E4/2,0). This is fine, however, the following rows in column J are sort of running total, instead of just the number divided by two that I want.

The problem is, I can't seem to figure out how to isolate just the number divided by two, but only if the balance is positive, AND only the amount that the entry from column E is above zero THEN divided by two.

In short, I have column for individual sales (E), sales rep commissions (G), and a sales account starting with $15,000.00 (J). If a sale loses -$191, then the company fronts the loss and the sales account goes to $14,809.00. If the next sale nets $2,520.00 profit, then 50% of it goes to the rep. But they first need to make up for the $191 loss. Then they gets 1/2 of whatever is over the $15,000.00.

So I need E, which is just the sales entry. G, which is a running total of sales. J, which is the sales rep's commission on individual sales. And L, which is a running total of the sales account (starting with $15000).

Again, the problem is in getting the 50% commission figure right. It's not a simple divide by two, because it only gets paid if: The sales doesn't result in a loss, AND if the sales account is greater than $15000. If the account is less than $15000, then either nothing is paid, or only the amount above $15000 divided by two.

I hope that makes sense. This might be more of a math problem than an Excel one and I'd greatly appreciate any help.

Thanks,
 
Ok, now that I am looking at your whole post, can you tell me why in this example from post #6:

Sale #2 results in a $1500 profit.
Sales Account = $15250
Commissions = $250

The commission is $250 and not $125.


igold
 
Upvote 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
On my sheet, with the columns laid out as E is sales and G is running total and J is commissions, the formula that works given your set of conditions is:

=IF(E3<0,0,IF(G3<0,0,IF(AND(E3>0,G3>E3),E3/2,G3/2)))


igold
 
Upvote 0
Same formula but with an OR statement instead of two IF's:

=IF(OR(E3<0,G3<0),0,IF(AND(E3>0,G3>E3),E3/2,G3/2))

igold
 
Upvote 0

Forum statistics

Threads
1,215,455
Messages
6,124,935
Members
449,195
Latest member
Stevenciu

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