Splitting Commission IF

greekexcel

New Member
Joined
Oct 31, 2022
Messages
32
Office Version
  1. 2019
Platform
  1. Windows
Hello everyone.
I have this table that calculates and splits the commission between sales reps.
Each salesrep has a different commission percentage(you can see it above his name)
DEMO FOR VBA1.xlsx
ABCDEFGHIJ
120%15%20%10%
2CP DATEVESSELSQMAREAAMOUNTSALES REPKEVINJOHNROBERTBILL
325/2/2022PENTHOUSE355CENTRE$ 29,673.00KEVIN$ 5,934.60$ -$ -$ -
426/2/2022LOFT230SOUTH$ 28,032.00JOHN$ -$ 4,204.80$ -$ -
527/2/2022MANSION147NORTH$ 44,865.00BILL$ -$ -$ -$ 4,486.50
628/2/2022LOFT194NORTH$ 48,492.00KEVIN & JOHN$ -$ -$ -$ -
71/3/2022MANSION88SOUTH$ 41,831.00BILL &KEVIN$ -$ -$ -$ -
82/3/2022HOUSE78CENTRE$ 59,924.00ROBERT$ -$ -$ 11,984.80$ -
93/3/2022MANSION84CENTRE$ 64,867.00BILL & JOHN & ROBERT$ -$ -$ -$ -
104/3/2022PENTHOUSE177SOUTH$ 72,451.00ROBERT & KEVIN$ -$ -$ -$ -
115/3/2022LOFT113NORTH$ 39,103.00KEVIN & JOHN$ -$ -$ -$ -
126/3/2022LOFT347SOUTH$ 45,335.00KEVIN$ 9,067.00$ -$ -$ -
137/3/2022MANSION173CENTRE$ 47,890.00BILL &KEVIN$ -$ -$ -$ -
148/3/2022HOUSE163SOUTH$ 78,916.00ROBERT & KEVIN$ -$ -$ -$ -
159/3/2022HOUSE100NORTH$ 36,550.00ROBERT & KEVIN$ -$ -$ -$ -
1610/3/2022PENTHOUSE51WEST$ 60,594.00JOHN & BILL$ -$ -$ -$ -
1711/3/2022LOFT375WEST$ 28,861.00BILL & KEVIN$ -$ -$ -$ -
1812/3/2022LOFT279NORTH$ 74,130.00KEVIN & JOHN$ -$ -$ -$ -
1913/3/2022MANSION330EAST$ 58,979.00BILL &KEVIN$ -$ -$ -$ -
2014/3/2022PENTHOUSE84SOUTH$ 72,012.00JOHN$ -$ 10,801.80$ -$ -
2115/3/2022LOFT164EAST$ 18,166.00ROBERT & BILL$ -$ -$ -$ -
2215/12/2022HOUSE212WEST$ 46,311.00ROBERT & JOHN & BILL$ -$ -$ -$ -
Sheet1
Cell Formulas
RangeFormula
G3:G22G3=IF([@[SALES REP]]=Table1[[#Headers],[KEVIN]],[@AMOUNT]*$G$1,0)
H3:H22H3=IF([@[SALES REP]]=Table1[[#Headers],[JOHN]],[@AMOUNT]*$H$1,0)
I3:I22I3=IF([@[SALES REP]]=Table1[[#Headers],[ROBERT]],[@AMOUNT]*$I$1,0)
J3:J22J3=IF([@[SALES REP]]=Table1[[#Headers],[BILL]],[@AMOUNT]*$J$1,0)


This formula only works when the sales is done individually.
I want a formula that calculates the commission for each salesrep if the sale is done individually according to his percentage
But if it is done in collaboration with another salesrep split the commission between them at 15% each
How do i combine this 2 criteria together and inside a table not normal range.

Thank u in advance.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
But if it is done in collaboration with another salesrep split the commission between them at 15% each
So are you saying that for row 9 each of the 3 reps get 15% meaning a total of 45% commission is paid?

Do you have the TEXTSPLIT function? That is, if you start typing =TEXT in a cell does this option appear?
1675078983470.png
 
Upvote 0
So are you saying that for row 9 each of the 3 reps get 15% meaning a total of 45% commission is paid?

Do you have the TEXTSPLIT function? That is, if you start typing =TEXT in a cell does this option appear?
View attachment 84145
Hello.
I dont have TEXTSPLIT function i am using excel 2019.
For row 9 and in any case that they are three sales reps the commission is 10% but that does not very frequently so i can manually input in the worst case scenario.
2 sales rep happens most frequently
Thank you
 
Upvote 0
I dont have TEXTSPLIT function i am using excel 2019.
Does your profile need updating then as it says 365 and 2021 as well as 2019?

For row 9 and in any case that they are three sales reps the commission is 10%
2 reps = 15% each
3 reps = 10% each

Is it a fair assumption then that however many multiple reps there are, they share 30%?
 
Upvote 0
Does your profile need updating then as it says 365 and 2021 as well as 2019?
I updated and now i have TEXTJOIN :)
2 reps = 15% each
3 reps = 10% each

Is it a fair assumption then that however many multiple reps there are, they share 30%?
That is correct but maybe Bill will still stay 10% at in collaboration as well.
Thank u in advance
 
Upvote 0
Try this in G3 and then copied down and across different agents :

=IF(ISNUMBER(SEARCH(G$2,$F3)),$E3/COUNTA(TEXTSPLIT($F3,"&"))*G$1,0)

I have considered commission on equal split of amount amongst the agents
 
Upvote 0
Try this in G3 and then copied down and across different agents :

=IF(ISNUMBER(SEARCH(G$2,$F3)),$E3/COUNTA(TEXTSPLIT($F3,"&"))*G$1,0)

I have considered commission on equal split of amount amongst the agents
First of all thank u for your response
I dont think the calculation works correct.
For example Row 6 Kevin's commission is 9698$ which is 20% not 15%
DEMO FOR VBA1.xlsx
ABCDEFGHIJ
120%15%20%10%
2CP DATEVESSELSQMAREAAMOUNTSALES REPKEVINJOHNROBERTBILL
325/2/2022PENTHOUSE355CENTRE$ 29,673.00KEVIN$ 5,934.60$ -$ -$ -
426/2/2022LOFT230SOUTH$ 28,032.00JOHN$ -$ 4,204.80$ -$ -
527/2/2022MANSION147NORTH$ 44,865.00BILL$ -$ -$ -$ 4,486.50
628/2/2022LOFT194NORTH$ 48,492.00KEVIN & JOHN$ 9,698.40$ 7,273.80$ -$ -
71/3/2022MANSION88SOUTH$ 41,831.00BILL &KEVIN$ 8,366.20$ -$ -$ 4,183.10
82/3/2022HOUSE78CENTRE$ 59,924.00ROBERT$ -$ -$ 11,984.80$ -
93/3/2022MANSION84CENTRE$ 64,867.00BILL & JOHN & ROBERT$ -$ 9,730.05$ 12,973.40$ 6,486.70
104/3/2022PENTHOUSE177SOUTH$ 72,451.00ROBERT & KEVIN$ 14,490.20$ -$ 14,490.20$ -
115/3/2022LOFT113NORTH$ 39,103.00KEVIN & JOHN$ 7,820.60$ 5,865.45$ -$ -
126/3/2022LOFT347SOUTH$ 45,335.00KEVIN$ 9,067.00$ -$ -$ -
137/3/2022MANSION173CENTRE$ 47,890.00BILL &KEVIN$ 9,578.00$ -$ -$ 4,789.00
148/3/2022HOUSE163SOUTH$ 78,916.00ROBERT & KEVIN$ 15,783.20$ -$ 15,783.20$ -
159/3/2022HOUSE100NORTH$ 36,550.00ROBERT & KEVIN$ 7,310.00$ -$ 7,310.00$ -
1610/3/2022PENTHOUSE51WEST$ 60,594.00JOHN & BILL$ -$ 9,089.10$ -$ 6,059.40
1711/3/2022LOFT375WEST$ 28,861.00BILL & KEVIN$ 5,772.20$ -$ -$ 2,886.10
1812/3/2022LOFT279NORTH$ 74,130.00KEVIN & JOHN$ 14,826.00$ 11,119.50$ -$ -
1913/3/2022MANSION330EAST$ 58,979.00BILL &KEVIN$ 11,795.80$ -$ -$ 5,897.90
2014/3/2022PENTHOUSE84SOUTH$ 72,012.00JOHN$ -$ 10,801.80$ -$ -
2115/3/2022LOFT164EAST$ 18,166.00ROBERT & BILL$ -$ -$ 3,633.20$ 1,816.60
2215/12/2022HOUSE212WEST$ 46,311.00ROBERT & JOHN & BILL$ -$ 6,946.65$ 9,262.20$ 4,631.10
Sheet1
Cell Formulas
RangeFormula
G3:J22G3=IF(ISNUMBER(SEARCH(G$2,$F3)),$E3/COUNTA(TEXTSPLIT($F3,"&"))*G$1,0)
 
Upvote 0
Try this instead :

=IF(ISNUMBER(SEARCH(G$2,$F3)),IF(AND(COUNTA(TEXTSPLIT($F3,"&"))>1,G$2<>"BILL"),$E3*15%,IF(AND(COUNTA(TEXTSPLIT($F3,"&"))>1,G$2="BILL"),$E3*$J$1,IF(COUNTA(TEXTSPLIT($F3,"&"))=1,$E3*G$1,0))),0)
 
Last edited:
Upvote 0
=IF(ISNUMBER(SEARCH(G$2,$F3)),IF(COUNTA(TEXTSPLIT($F3,"&"))>1,$E3*15%,IF(COUNTA(TEXTSPLIT($F3,"&"))=1,$E3*G$1,0)),0)
Unfortunately still the same
DEMO FOR VBA1.xlsx
ABCDEFGHIJ
120%15%20%10%
2CP DATEVESSELSQMAREAAMOUNTSALES REPKEVINJOHNROBERTBILL
325/2/2022PENTHOUSE355CENTRE$ 29,673.00KEVIN$ 5,934.60$ -$ -$ -
426/2/2022LOFT230SOUTH$ 28,032.00JOHN$ -$ 4,204.80$ -$ -
527/2/2022MANSION147NORTH$ 44,865.00BILL$ -$ -$ -$ 4,486.50
628/2/2022LOFT194NORTH$ 48,492.00KEVIN & JOHN$ 9,698.40$ 7,273.80$ -$ -
71/3/2022MANSION88SOUTH$ 41,831.00BILL &KEVIN$ 8,366.20$ -$ -$ 4,183.10
82/3/2022HOUSE78CENTRE$ 59,924.00ROBERT$ -$ -$ 11,984.80$ -
93/3/2022MANSION84CENTRE$ 64,867.00BILL & JOHN & ROBERT$ -$ 9,730.05$ 12,973.40$ 6,486.70
104/3/2022PENTHOUSE177SOUTH$ 72,451.00ROBERT & KEVIN$ 14,490.20$ -$ 14,490.20$ -
115/3/2022LOFT113NORTH$ 39,103.00KEVIN & JOHN$ 7,820.60$ 5,865.45$ -$ -
126/3/2022LOFT347SOUTH$ 45,335.00KEVIN$ 9,067.00$ -$ -$ -
137/3/2022MANSION173CENTRE$ 47,890.00BILL &KEVIN$ 9,578.00$ -$ -$ 4,789.00
148/3/2022HOUSE163SOUTH$ 78,916.00ROBERT & KEVIN$ 15,783.20$ -$ 15,783.20$ -
159/3/2022HOUSE100NORTH$ 36,550.00ROBERT & KEVIN$ 7,310.00$ -$ 7,310.00$ -
1610/3/2022PENTHOUSE51WEST$ 60,594.00JOHN & BILL$ -$ 9,089.10$ -$ 6,059.40
1711/3/2022LOFT375WEST$ 28,861.00BILL & KEVIN$ 5,772.20$ -$ -$ 2,886.10
1812/3/2022LOFT279NORTH$ 74,130.00KEVIN & JOHN$ 14,826.00$ 11,119.50$ -$ -
1913/3/2022MANSION330EAST$ 58,979.00BILL &KEVIN$ 11,795.80$ -$ -$ 5,897.90
2014/3/2022PENTHOUSE84SOUTH$ 72,012.00JOHN$ -$ 10,801.80$ -$ -
2115/3/2022LOFT164EAST$ 18,166.00ROBERT & BILL$ -$ -$ 3,633.20$ 1,816.60
2215/12/2022HOUSE212WEST$ 46,311.00ROBERT & JOHN & BILL$ -$ 6,946.65$ 9,262.20$ 4,631.10
Sheet1
Cell Formulas
RangeFormula
G3:G22G3=IF(ISNUMBER(SEARCH(G$2,$F3)),IF(COUNTA(TEXTSPLIT($F3,"&"))>1,$E3*15%,IF(COUNTA(TEXTSPLIT($F3,"&"))=1,$E3*G$1,0)),0)
H3:J22H3=IF(ISNUMBER(SEARCH(H$2,$F3)),$E3/COUNTA(TEXTSPLIT($F3,"&"))*H$1,0)
 
Upvote 0
Temp.xlsx
ABCDEFGHIJ
120%15%20%10%
2CP DATEVESSELSQMAREAAMOUNTSALES REPKEVINJOHNROBERTBILL
325/02/2022PENTHOUSE355CENTRE$29,673.00KEVIN$ 5,934.60$ -$ -$ -
426/02/2022LOFT230SOUTH$28,032.00JOHN$ -$ 4,204.80$ -$ -
527/02/2022MANSION147NORTH$44,865.00BILL$ -$ -$ -$4,486.50
628/02/2022LOFT194NORTH$48,492.00KEVIN & JOHN$ 7,273.80$ 7,273.80$ -$ -
701/03/2022MANSION88SOUTH$41,831.00BILL &KEVIN$ 6,274.65$ -$ -$4,183.10
802/03/2022HOUSE78CENTRE$59,924.00ROBERT$ -$ -$11,984.80$ -
903/03/2022MANSION84CENTRE$64,867.00BILL & JOHN & ROBERT$ -$ 9,730.05$ 9,730.05$6,486.70
1004/03/2022PENTHOUSE177SOUTH$72,451.00ROBERT & KEVIN$10,867.65$ -$10,867.65$ -
1105/03/2022LOFT113NORTH$39,103.00KEVIN & JOHN$ 5,865.45$ 5,865.45$ -$ -
1206/03/2022LOFT347SOUTH$45,335.00KEVIN$ 9,067.00$ -$ -$ -
1307/03/2022MANSION173CENTRE$47,890.00BILL &KEVIN$ 7,183.50$ -$ -$4,789.00
1408/03/2022HOUSE163SOUTH$78,916.00ROBERT & KEVIN$11,837.40$ -$11,837.40$ -
1509/03/2022HOUSE100NORTH$36,550.00ROBERT & KEVIN$ 5,482.50$ -$ 5,482.50$ -
1610/03/2022PENTHOUSE51WEST$60,594.00JOHN & BILL$ -$ 9,089.10$ -$6,059.40
1711/03/2022LOFT375WEST$28,861.00BILL & KEVIN$ 4,329.15$ -$ -$2,886.10
1812/03/2022LOFT279NORTH$74,130.00KEVIN & JOHN$11,119.50$11,119.50$ -$ -
1913/03/2022MANSION330EAST$58,979.00BILL &KEVIN$ 8,846.85$ -$ -$5,897.90
2014/03/2022PENTHOUSE84SOUTH$72,012.00JOHN$ -$10,801.80$ -$ -
2115/03/2022LOFT164EAST$18,166.00ROBERT & BILL$ -$ -$ 2,724.90$1,816.60
2215/12/2022HOUSE212WEST$46,311.00ROBERT & JOHN & BILL$ -$ 6,946.65$ 6,946.65$4,631.10
Sheet1
Cell Formulas
RangeFormula
G3:J22G3=IF(ISNUMBER(SEARCH(G$2,$F3)),IF(AND(COUNTA(TEXTSPLIT($F3,"&"))>1,G$2<>"BILL"),$E3*15%,IF(AND(COUNTA(TEXTSPLIT($F3,"&"))>1,G$2="BILL"),$E3*$J$1,IF(COUNTA(TEXTSPLIT($F3,"&"))=1,$E3*G$1,0))),0)
 
Upvote 0

Forum statistics

Threads
1,223,231
Messages
6,170,884
Members
452,364
Latest member
springate

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