IF with Unless conditions?

Koleyd

New Member
Joined
Aug 25, 2021
Messages
6
Office Version
  1. 365
Platform
  1. Windows

Hi, Hoping I can get some assistance on this. So I'm pretty much a novice excel user when it comes to formulas and logics; but I am trying to somewhat automate a commission report we use with a few different formulas for requirements.
There are a few conditions that need to be met and different results to be returned.
We have a Specific Customer set value; a Standard Item value and a few Specific Item values.
What I need to do is:
If Customer # H= 'this' then return "$ value" for all entries (eg.7.00); UNLESS the Item # Q= 'this or this' (the vlookup of the formula) then return value from column 2; BUT if neither is true then return Standard Item Value '$10.00'.
However, I literally do not know enough about excel to make this work as a formula and no amount of googling has rendered a result that works either :( .
I assume that it can be done?
Below is what I have been working with and it kind of works. But it only returns the Customer value because it is true; then ignores the rest of the requirements. Help! :(

EXAMPLE ONLY =IFERROR(IF(H11="A101042AUD","7.00",(VLOOKUP(Q11,Sheet2!$F$2:$G$4,2,FALSE))),10)
1631082421407.png

Please tell me this can be done? And thanks in advance any assistance would be greatly appreciated.
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
I hope this works!

Book1
HIJKLMNOPQRSTUVWXYZAA
1CUST #NAMEDATESALESAGENTITEM #PRODUCTcatergorylocationMTUNITEXT PRCOM RATECOM DUE
2A101539STAN8/2/2021SALESAGENTFA001APPLEScatergorylocation49.99527.0026 344.735.00249.95
3A101042JOE8/4/2021SALESAGENTMIKESFM001ORANGEScatergorylocation29.00505.0014 645.005.00145.00
4A101042JOE8/4/2021SALESAGENTMIKESFM001ORANGEScatergorylocation31.05505.0015 680.255.00155.25
5A101539STAN8/4/2021SALESAGENTFA001APPLEScatergorylocation50.03527.0026 365.815.00250.15
6A101410ERIC8/5/2021SALESAGENTFM001ORANGEScatergorylocation20.00628.0012 560.005.00100.00
7A102470PAUL8/5/2021SALESAGENTFA001APPLEScatergorylocation54.02588.0031 763.765.00270.10
8A101042JOE8/9/2021SALESAGENTMIKESFM001ORANGEScatergorylocation30.05505.0015 175.255.00150.25
9A101042JOE8/9/2021SALESAGENTMIKESFM001ORANGEScatergorylocation30.00600.0018 000.005.00150.00
10A102470PAUL8/7/2021SALESAGENTFA001APPLEScatergorylocation54.02588.0031 763.765.00270.10
11A102528MICHAEL8/10/2021SALESAGENTFM190PEACHEScatergorylocation10.00628.006 280.0010.00100.00
12A101410ERIC8/14/2021SALESAGENTFM001ORANGEScatergorylocation20.00628.0012 560.005.00100.00
13A101042JOE8/13/2021SALESAGENTMIKESFM001ORANGEScatergorylocation53.75505.0027 143.755.00268.75
14A101042JOE8/11/2021SALESAGENTMIKESFA001APPLEScatergorylocation54.00598.0032 292.005.00270.00
15A101756DAVE8/18/2021SALESAGENTFN0036AVOCADOScatergorylocation16.00493.007 888.0010.00160.00
16A101042JOE8/19/2021SALESAGENTMIKESFF062PLUMScatergorylocation25.00484.0012 100.0010.00250.00
Sheet1
Cell Formulas
RangeFormula
Z2:Z16Z2=IFERROR(IF(H2="A101042AUD","7.00",(VLOOKUP(Q2,Sheet2!$F$2:$G$4,2,FALSE))),10)
AA2:AA16AA2=SUM(Z2*W2)



Book1
DEFG
1
2COMMISSION RATE TABLE
3FM0015
4FA0015
5EVERYTHING ELSE10
6
7
8CUSTOMER TABLE
9A1010425
10A1015527
11
Sheet2
 
Upvote 0
pLEAS
I hope this works!

Book1
HIJKLMNOPQRSTUVWXYZAA
1CUST #NAMEDATESALESAGENTITEM #PRODUCTcatergorylocationMTUNITEXT PRCOM RATECOM DUE
2A101539STAN8/2/2021SALESAGENTFA001APPLEScatergorylocation49.99527.0026 344.735.00249.95
3A101042JOE8/4/2021SALESAGENTMIKESFM001ORANGEScatergorylocation29.00505.0014 645.005.00145.00
4A101042JOE8/4/2021SALESAGENTMIKESFM001ORANGEScatergorylocation31.05505.0015 680.255.00155.25
5A101539STAN8/4/2021SALESAGENTFA001APPLEScatergorylocation50.03527.0026 365.815.00250.15
6A101410ERIC8/5/2021SALESAGENTFM001ORANGEScatergorylocation20.00628.0012 560.005.00100.00
7A102470PAUL8/5/2021SALESAGENTFA001APPLEScatergorylocation54.02588.0031 763.765.00270.10
8A101042JOE8/9/2021SALESAGENTMIKESFM001ORANGEScatergorylocation30.05505.0015 175.255.00150.25
9A101042JOE8/9/2021SALESAGENTMIKESFM001ORANGEScatergorylocation30.00600.0018 000.005.00150.00
10A102470PAUL8/7/2021SALESAGENTFA001APPLEScatergorylocation54.02588.0031 763.765.00270.10
11A102528MICHAEL8/10/2021SALESAGENTFM190PEACHEScatergorylocation10.00628.006 280.0010.00100.00
12A101410ERIC8/14/2021SALESAGENTFM001ORANGEScatergorylocation20.00628.0012 560.005.00100.00
13A101042JOE8/13/2021SALESAGENTMIKESFM001ORANGEScatergorylocation53.75505.0027 143.755.00268.75
14A101042JOE8/11/2021SALESAGENTMIKESFA001APPLEScatergorylocation54.00598.0032 292.005.00270.00
15A101756DAVE8/18/2021SALESAGENTFN0036AVOCADOScatergorylocation16.00493.007 888.0010.00160.00
16A101042JOE8/19/2021SALESAGENTMIKESFF062PLUMScatergorylocation25.00484.0012 100.0010.00250.00
Sheet1
Cell Formulas
RangeFormula
Z2:Z16Z2=IFERROR(IF(H2="A101042AUD","7.00",(VLOOKUP(Q2,Sheet2!$F$2:$G$4,2,FALSE))),10)
AA2:AA16AA2=SUM(Z2*W2)



Book1
DEFG
1
2COMMISSION RATE TABLE
3FM0015
4FA0015
5EVERYTHING ELSE10
6
7
8CUSTOMER TABLE
9A1010425
10A1015527
11
Sheet2
Please explain this piece
But it only returns the Customer value because it is true; then ignores the rest of the requirements. Help! :(

The formula seems correct what else are you expecting.
 
Upvote 0
pLEAS

Please explain this piece
But it only returns the Customer value because it is true; then ignores the rest of the requirements. Help! :(

The formula seems correct what else are you expecting.


Apologies, I think I have not included the altered formula to work with the example information. Please see this one. Note the highlighted line. The Customer Number is true in the formula; so the $7 value is returned; however the Item # is also one of the requirements that should take precedence over the Customer number and return a value of $5. Does that make sense?

If customer is A101042 then return $7 UNLESS the item number is FM001 (from the table) then return $5; irrespective of the customer number being true.

Also to add to this, I would like the ability to search the Customer Table for the customer numbers and associated rate, rather than having a static value placed inside the formula as it currently stands.

com report test.xlsx
HIJKLMNOPQRSTUVWXYZAA
1CUST #NAMEDATESALESAGENTITEM #PRODUCTcatergorylocationMTUNITEXT PRCOM RATECOM DUE
2A101539STAN02/08/2021SALESAGENTFA001APPLEScatergorylocation49.99500.0024 995.005.00249.95
3A101042JOE04/08/2021SALESAGENTMIKESFM001ORANGEScatergorylocation29.00500.0014 500.007.00203.00
4A101042JOE04/08/2021SALESAGENTMIKESFM001ORANGEScatergorylocation31.05500.0015 525.007.00217.35
5A101539STAN04/08/2021SALESAGENTFA001APPLEScatergorylocation50.03500.0025 015.005.00250.15
6A101410ERIC05/08/2021SALESAGENTFM001ORANGEScatergorylocation20.00500.0010 000.005.00100.00
7A102470PAUL05/08/2021SALESAGENTFA001APPLEScatergorylocation54.02500.0027 010.005.00270.10
8A101042JOE09/08/2021SALESAGENTMIKESFM001ORANGEScatergorylocation30.05500.0015 025.007.00210.35
9A101042JOE09/08/2021SALESAGENTMIKESFM001ORANGEScatergorylocation30.00500.0015 000.007.00210.00
10A102470PAUL07/08/2021SALESAGENTFA001APPLEScatergorylocation54.02500.0027 010.005.00270.10
11A102528MICHAEL10/08/2021SALESAGENTFM190PEACHEScatergorylocation10.00600.006 000.0010.00100.00
12A101410ERIC14/08/2021SALESAGENTFM001ORANGEScatergorylocation20.00500.0010 000.005.00100.00
13A101042JOE13/08/2021SALESAGENTMIKESFM001ORANGEScatergorylocation53.75500.0026 875.007.00376.25
14A101042JOE11/08/2021SALESAGENTMIKESFA001APPLEScatergorylocation54.00500.0027 000.007.00378.00
15A101756DAVE18/08/2021SALESAGENTFN0036AVOCADOScatergorylocation16.00700.0011 200.0010.00160.00
16A101042JOE19/08/2021SALESAGENTMIKESFF062PLUMScatergorylocation25.00500.0012 500.007.00175.00
17
Sheet1
Cell Formulas
RangeFormula
Y2:Y16Y2=X2*W2
Z2:Z16Z2=IFERROR(IF(H2="A101042","7.00",(VLOOKUP(Q2,Sheet2!$F$2:$G$4,2,FALSE))),10)
AA2:AA16AA2=SUM(Z2*W2)



com report test.xlsx
FG
1
2COMMISSION RATE TABLE
3FM0015
4FA0015
5EVERYTHING ELSE10
6
7
8CUSTOMER TABLE
9A1010427
10A1015525
Sheet2
 
Upvote 0
Try now . I have intentionally Kept Zero where customer doesn't exist if you still want 10 to appear then apply below formula

=IF(A2="","",IFERROR(IF(NOT(ISERROR(VLOOKUP(J2,$V$3:$W$4,2,0))),5,VLOOKUP(A2,$V$9:$W$10,2,0)),10))


Book1
ABCDEFGHIJKLMNOPQRSTUVW
1CUST #NAMEDATESALESAGENTITEM #PRODUCTcatergorylocationMTUNITEXT PRCOM RATECOM DUE
2A101539STAN2-Aug-21SALESAGENTFA001APPLEScatergorylocation49.99500050COMMISSION RATE TABLE
3A101042JOE4-Aug-21SALESAGENTMIKESFM001ORANGEScatergorylocation29500050FM0015
4A101042JOE4-Aug-21SALESAGENTMIKESFM001ORANGEScatergorylocation31.05500050FA0015
5A101539STAN4-Aug-21SALESAGENTFA001APPLEScatergorylocation50.03500050EVERYTHING ELSE10
6A101410ERIC5-Aug-21SALESAGENTFM001ORANGEScatergorylocation20500050
7A102470PAUL5-Aug-21SALESAGENTFA001APPLEScatergorylocation54.02500050
8A101042JOE9-Aug-21SALESAGENTMIKESFM001ORANGEScatergorylocation30.05500050CUSTOMER TABLE
9A101042JOE9-Aug-21SALESAGENTMIKESFM001ORANGEScatergorylocation30500050A1010427
10A102470PAUL7-Aug-21SALESAGENTFA001APPLEScatergorylocation54.02500050A1015525
11A102528MICHAEL10-Aug-21SALESAGENTFM190PEACHEScatergorylocation10600000
12A101410ERIC14-Aug-21SALESAGENTFM001ORANGEScatergorylocation20500050
13A101042JOE13-Aug-21SALESAGENTMIKESFM001ORANGEScatergorylocation53.75500050
14A101042JOE11-Aug-21SALESAGENTMIKESFA001APPLEScatergorylocation54500050
15A101756DAVE18-Aug-21SALESAGENTFN0036AVOCADOScatergorylocation16700000
16A101042JOE19-Aug-21SALESAGENTMIKESFF062PLUMScatergorylocation25500070
Sheet1
Cell Formulas
RangeFormula
R2:R16R2=X2*W2
S2:S16S2=IF(A2="","",IFERROR(IF(NOT(ISERROR(VLOOKUP(J2,$V$3:$W$4,2,0))),5,VLOOKUP(A2,$V$9:$W$10,2,0)),0))
T2:T16T2=SUM(Z2*W2)
 
Upvote 0
Solution
Try now . I have intentionally Kept Zero where customer doesn't exist if you still want 10 to appear then apply below formula

=IF(A2="","",IFERROR(IF(NOT(ISERROR(VLOOKUP(J2,$V$3:$W$4,2,0))),5,VLOOKUP(A2,$V$9:$W$10,2,0)),10))

OMG, thanks so much! This works perfectly; and I can expand on item numbers & customers!! You're a Champion!! ?
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,906
Members
452,366
Latest member
TePunaBloke

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