Extract first instance of Invoice number/freight charge from one sheet by Invoice number from another sheet

DennisYoung

New Member
Joined
Jun 27, 2022
Messages
14
Office Version
  1. 2021
  2. 2016
Platform
  1. Windows
I have 2 sheets, the first (Sheet1) with a list of unique Invoice numbers, the second sheet (Sheet2) has duplicate Invoice numbers and freight charges. I want to extract just the first freight charge from sheet 2 into a new column in sheet1 by the invoice number

Sheet1 Sheet2 Final Sheet1

A B A B A B
Invoice# Freight$ Invoice# Freight$ Invoice# Freight$
123456 123456 $100.00 123456 $100.00
123457 123456 $100.00 123457 $200.00
123458 123456 $100.00 123458 $300.00
123457 $200.00
123457 $200.00
123458 $300.00
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Could sheet 2 have different charges for the same invoice?
 
Upvote 0
In that case you can use
Excel Formula:
=INDEX(Sheet2!$B$2:$B$500,MATCH(A2,Sheet2!$A$2:$A$500,0))
 
Upvote 0
In that case you can use
Excel Formula:
=INDEX(Sheet2!$B$2:$B$500,MATCH(A2,Sheet2!$A$2:$A$500,0))
I messed up, I had it backwards a bit. Sorry!

Sheet1 has Sheet2 has
Invoice$ Freight$....................Invoice# Freight$
123456 123456 100.00
123456 123457 200.00
123456 123458 300.00
123457
123457
123458

and I need
Sheet1
Invoice# Freight$
123456 100.00
123456
123456
123457 200.00
123457
123458 300.00
 
Upvote 0
How about
Excel Formula:
=IF(COUNTIFS(A$2:A2,A2)=1,SUMIFS(Sheet2!B:B,Sheet2!A:A,A2),"")
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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