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

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
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,215,336
Messages
6,124,328
Members
449,155
Latest member
ravioli44

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