Share information between sheets to show item age

lauralizalfos

New Member
Joined
Nov 29, 2023
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I'm trying to track product returns and determine the year a unit was built based off of it's serial number.
I have a sheet that lists the serial number of the first product shipped in a given year, and another sheet with the product and serial number that has been returned. I would like a way for excel to quickly output the production year for the returned item, so I don't have to look it all up manually.

For example we have Sheet 1:
1701303755393.png


And Sheet 2:
1701303776147.png


I've tried using a series of "=IF" statements, which almost got me where I wanted, but I want it to be able to know to look at the Hookshot row and pull the data that way.

If there's a better way to organize my sheets I can adapt.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Welcome to the MrExcel board!

For the future, please investigate XL2BB for providing sample data to make it easier for helpers by not having to manually type out sample data to test with. :)

It depends on how realistic your sample data is. Do the Serial numbers actually have a rigid format of two letters (always the same for the same product) followed by exactly 4 digits? If so, you could try something like this. Check the table name in the formula.

lauralizalfos.xlsm
ABCDEF
1Item20192020202120222023
2HookshotAA1001AA1052AA1105AA1220AA1345
3BoomerangBB1001BB1210BB1501BB1698BB1785
4OcarinaCC1001CC1036CC1108CC1175
5SlingshotDD1001DD1075DD1154DD1222
Sheet2



lauralizalfos.xlsm
ABC
1Returned ItemSerial NumYear
2HookshotAA10242019
3BoomerangBB14422020
4SlingshotDD12232023
5ArrowXX1234#N/A
6BoomerangBB0900#N/A
Sheet1
Cell Formulas
RangeFormula
C2:C6C2=XLOOKUP([@[Serial Num]],FILTER(tblShipped,tblShipped[Item]=[@[Returned Item]],NA()),tblShipped[#Headers],,-1)
 
Upvote 0
Thanks for your help, Peter, I've added XL2BB for future use!

I'm still running into an issue, using the formula you've shared I am presented with a syntax error
Screenshot 2023-11-30 112432.png

And when I click OK it highlights the first part of the formula
Screenshot 2023-11-30 112450.png


I made sure to name the table on Sheet 2 to "Shipped," do I need to rename anything on sheet1? This has all been tested with the same data you shared, copy/pasted into my excel.

Also, to answer your question, yes, the serial number format is rigid for all the products. Some combination of 2 letters (AA, FN, HG) followed by 5 digits. So "AA10243" or "BQ10054" are both valid serial numbers

Serial Num Year Test.xlsx
ABC
1Returned ItemSerial NumYear
2HookshotAA1024=XLOOKUP([@[Serial Num]],FILTER(tblShipped,tblShipped[Item]=[@[Returned Item]],NA()),tblShipped[#Headers],,-1)
3BoomerangBB1442=XLOOKUP([@[Serial Num]],FILTER(tblShipped,tblShipped[Item]=[@[Returned Item]],NA()),tblShipped[#Headers],,-1)
4SlingshotDD1223=XLOOKUP([@[Serial Num]],FILTER(tblShipped,tblShipped[Item]=[@[Returned Item]],NA()),tblShipped[#Headers],,-1)
5ArrowXX1234=XLOOKUP([@[Serial Num]],FILTER(tblShipped,tblShipped[Item]=[@[Returned Item]],NA()),tblShipped[#Headers],,-1)
6BoomerangBB0900=XLOOKUP([@[Serial Num]],FILTER(tblShipped,tblShipped[Item]=[@[Returned Item]],NA()),tblShipped[#Headers],,-1)
Sheet1


Serial Num Year Test.xlsx
ABCDEF
1Item20192020202120222023
2HookshotAA1001AA1052AA1105AA1220AA1345
3BoomerangBB1001BB1210BB1501BB1698BB1785
4OcarinaCC1001CC1036CC1108CC1175
5SlingshotDD1001DD1075DD1154DD1222
Sheet2
 
Upvote 0
And when I click OK it highlights the first part of the formula
That seems to be indicating that there is a discrepancy between the serial number heading in the Sheet1 table and the serial number heading used in the formula in Sheet1. Try removing the space between the two words in the heading and in the formula as shown here

1701412260620.png
 
Upvote 0
That seems to be indicating that there is a discrepancy between the serial number heading in the Sheet1 table and the serial number heading used in the formula in Sheet1. Try removing the space between the two words in the heading and in the formula as shown here

View attachment 102797
We're getting warmer!

I changed a few header names so everything was happy, and I also found that the latter 2 "tblShipped" in the formula had to be condensed to just "Shipped", or it would pop up the same syntax error I shared before.
I no longer get any pop-up syntax warnings when I input the formula, but it's still not outputting the year, and just giving me a #NAME? error.
I've tried referencing Shipping[ItemName] and Shipping[@ItemName] to see if either of those would get it working, but it seems like that's not doing the trick.


Book1
ABC
1ReturnedItemSerialNumYear
2HookshotAA1024#NAME?
3BoomerangBB1442#NAME?
4SlingshotDD1223#NAME?
5ArrowXX1234#NAME?
6BoomerangBB0900#NAME?
Sheet1
Cell Formulas
RangeFormula
C2C2=XLOOKUP([@SerialNum],FILTER(tblShipped,Shipped[ItemName]=[@ReturnedItem],NA()),Shipped[#Headers],,-1)
C3:C6C3=XLOOKUP([@SerialNum],FILTER(tblShipped,Shipped[@ItemName]=[@ReturnedItem],NA()),Shipped[#Headers],,-1)

Book1
ABCDEF
1ItemName20192020202120222023
2HookshotAA1001AA1052AA1105AA1220AA1345
3BoomerangBB1001BB1210BB1501BB1698BB1785
4OcarinaCC1001CC1036CC1108CC1175
5SlingshotDD1001DD1075DD1154DD1222
Sheet2
 
Upvote 0
That seems to be indicating that there is a discrepancy between the serial number heading in the Sheet1 table and the serial number heading used in the formula in Sheet1. Try removing the space between the two words in the heading and in the formula as shown here

View attachment 102797
Good news! I kept playing with the formula, and I removed the first "tbl" and the system works! I used the code with my actual existing product serial number table and it works flawlessly.

Thank you so much for your help!

Here's the code that ended up working:
=XLOOKUP([@SerialNum],FILTER(Shipped,Shipped[ItemName]=[@ReturnedItem],NA()),Shipped[#Headers],,-1)
 
Upvote 0
Since you didn't originally indicate what the table names were, I did mention in post 2 to check the table name. ;)
Check the table name in the formula.


I used the code with my actual existing product serial number table and it works flawlessly.

Here's the code that ended up working:
=XLOOKUP([@SerialNum],FILTER(Shipped,Shipped[ItemName]=[@ReturnedItem],NA()),Shipped[#Headers],,-1)
Hmm, that doesn't see quite right to me since in that formula there is no space in 'SerialNum' but in your original image there clearly is.
1701487008341.png


Anyway, the main thing is that you got it working in the end. Thanks for letting us know. :)
 
Upvote 0

Forum statistics

Threads
1,215,125
Messages
6,123,195
Members
449,090
Latest member
bes000

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