[Solved] Data in 2 tables, need to cross reference it

Discuss the spreadsheet application
Post Reply
keystonecandle
Posts: 3
Joined: Wed Jan 02, 2013 11:35 pm

[Solved] Data in 2 tables, need to cross reference it

Post by keystonecandle »

Hi all, I'm sorry I don't even know the right way to title this question. It isn't complicated but hard to explain. My website exports order information in multiple tables. One gives all the customer info ( order ID, customer info, totals, STATUS, etc.) The second gives all the ordered ITEMS info (order ID, items ordered, price, quantity, etc) What I want is for the STATUS from table 1 to be inserted into a column in table 2 in each row that corresponds with the order ID from both tables (worded horribly) Here is an example that should help. Both tables are in the same sheet (sheet 1)

Table 1
!ORDERID   !STATUS
5             C
6             F
7             F
8             I
9             P
Table 2
!ORDERID      !PRODUCT           !QUANTITY
5             widget blue         2
5             widget red          1
5             widget yellow     5
6             widget blue        1
7             widget blue        3
7             widget yellow     2
8             widget yellow     1
9             widget yellow     6
What I would like as my result is this...
!ORDERID      !PRODUCT        !QUANTITY    !STATUS
5             widget blue         2             C
5             widget red          1             C
5             widget yellow     5              C
6             widget blue        1              F
7             widget blue        3              F
7             widget yellow     2             F
8             widget yellow     1             I
9             widget yellow     6             P
I've tried consolidate but may not be using it correctly. Not sure what other options I have,
thanks for taking a look.
Last edited by MrProgrammer on Tue Jun 15, 2021 8:39 pm, edited 1 time in total.
Reason: Tagged ✓ [Solved]
OpenOffice 3.3 on Windows 7
FJCC
Moderator
Posts: 9280
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: order data in 2 tables, need to cross reference data

Post by FJCC »

See the use of the VLOOKUP function in column G of the attached file.
Attachments
Orders.ods
(9.69 KiB) Downloaded 77 times
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Post Reply