If a list contains a specific value fill with adjacent cell

a cow tent

New Member
Joined
Jan 28, 2023
Messages
5
Office Version
  1. 2016
Platform
  1. Windows
Hello All,

I'm trying to find a quicker way to complete commission reports.
What formula can I put in the highlighted cells on sheet 2 to pull the quantity sold from sheet 1?

The concept I'm seeing is:
If the item number column on sheet 1 contains a specific value, take its adjacent cell's value in the quantity sold column and put it in the highlighted cell on sheet 2.
If the item number column on sheet 1 does not contain the specific value, put 0 in the highlighted cell on sheet 2.

I am open to a simpler concept, but I just want to paste my raw data on sheet 1 and have the report on sheet 2 fill itself in.
There are roughly 300 item numbers, and each salesman has anywhere from 1 to 60 specific item numbers he can gain commission from.
The commission prices are different from what's on the raw data report, so only item number and quantity sold are relevant.

Raw Data (Sheet 1)
1674943852125.png




Salesman Commission Summary (Sheet 2)
1674943951153.png
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
A VLOOKUP should be all you need:

Mr Excel Questions.xlsx
ABCDE
1
2Item NumberQuantity SoldPrice %Commission
3155%0.2500
4212%0.0200
5343%0.1200
6
7
SalesCom2
Cell Formulas
RangeFormula
B3:B5B3=VLOOKUP(A3,SalesCom1!$A$2:$B$11,2,0)
D3:D5D3=B3*C3



Mr Excel Questions.xlsx
ABCD
1Item NumberQuantity Sold
215
321
434
548
652
763
874
989
1095
11100
12
SalesCom1
 
Upvote 0
A VLOOKUP should be all you need:

Mr Excel Questions.xlsx
ABCDE
1
2Item NumberQuantity SoldPrice %Commission
3155%0.2500
4212%0.0200
5343%0.1200
6
7
SalesCom2
Cell Formulas
RangeFormula
B3:B5B3=VLOOKUP(A3,SalesCom1!$A$2:$B$11,2,0)
D3:D5D3=B3*C3



Mr Excel Questions.xlsx
ABCD
1Item NumberQuantity Sold
215
321
434
548
652
763
874
989
1095
11100
12
SalesCom1
Thank you, awoohaw!
 
Upvote 0
If it helps anyone else, I changed the formula to =IFERROR(VLOOKUP(A3,Sheet1!$A$2:$B$11,2,0),0) so it displays 0's instead of N/A's.
 
Upvote 0
If it helps anyone else, I changed the formula to =IFERROR(VLOOKUP(A3,Sheet1!$A$2:$B$11,2,0),0) so it displays 0's instead of N/A's.
There is a specific function to deal with #N/A errors (& it's shorter to type than IFERROR. ;))

=IFNA(VLOOKUP(A3,Sheet1!$A$2:$B$11,2,0),0)
 
Upvote 0

Forum statistics

Threads
1,215,012
Messages
6,122,682
Members
449,091
Latest member
peppernaut

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