How many actually sales

Copper Contributor

Hi, 

 

I have to find the formula to put in actually sales in my tabel wich shows what I put in order. 
I have a tabel wich shows exactly what I sat in ordrer with GTIN and cuantum, and I also have a tabel wich shows exactly what I sold of each thing with GTIN and cuantum. 

ronjaham_0-1679643459475.png

As you can see here, 
To the right I have the ones that I sat in order, and to the left is the one that is actually sold with the right ammount of what I sold of each thing. 
So I need a formula wich let me put this togheter so the numbers of actually sold will come in tho the tabel togheter with what I ordered.


2 Replies

@ronjaham 

Couldn't see the picture clearly, too small...even with the enlargement (probably due to my graphics driver). A step-by-step description of your project would be more helpful in this case.

 

However...It sounds like you need to use a VLOOKUP formula to match the GTIN values from the two tables and return the quantity sold for each item. A VLOOKUP formula looks like this:

=VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])

where lookup_value is the GTIN value you want to match, table_array is the range of cells that contains the sales data, col_index_num is the column number that contains the quantity sold, and range_lookup is an optional argument that specifies whether you want an exact match (FALSE) or an approximate match (TRUE).

For example, if your order table is in columns A and B, and your sales table is in columns D and E, you can use this formula in cell C2 to get the quantity sold for the item in cell A2:

=VLOOKUP(A2,D:E,2,FALSE)

 

You can then copy this formula down to fill the rest of column C with the corresponding quantities sold for each item.

 

This way, you can compare what you ordered with what you actually sold.

 

I hope this helps. 

 

@ronjaham 

These formulas are very version dependent.  One has been able to use Tables to reference data from 2007 but it is only recently that XLOOKUP has replaced VLOOKUP.

"Within orders table"
= XLOOKUP([@GTIN], Sales[GTIN], Sales[Sold], 0)

"As an array formula used outside any table"
= XLOOKUP(orders[GTIN], Sales[GTIN], Sales[Sold], 0)

If you are using legacy versions of Excel the VLOOKUP solution posted by @NikolinoDE is all you have available to you.  I would still recommend the use of Tables and Structured References though.