I have 2 tables. Table 1 has employees and Table 2 has codes and their values.
For each employee row in Table 1 by looking up the last 5 characters and matching it Table 2 Column header,I want to insert new rows with all of the Table 2 Code rows and correspondnig "Plan" column value.
For Example, in Table1 1st row EE_Plan1, the last 5 characters "Plan1" should match the 2nd column in Table2, get the plan values (123,879) and insert new code rows as shown below in END RESULT.
Really appreciate any help with creating a formula. Thank you!!
TABLE1
Employee
--------
EE_Plan1
EE_Plan2
EE_Plan3
TABLE2
Code Plan1 Plan2 Plan3
---- ----- ----- -----
DND 123 456 jgh
ABC 879 978 ajs
END RESULT
Employee Code Plan Desc
-------- ---- ---------
EE_Plan1 DND 123
EE_Plan1 ABC 879
EE_Plan2 DND 456
EE_Plan2 ABC 978
EE_Plan3 DND jgh
EE_Plan3 ABC ajs
Vlookups are your friend here. Use a VLOOKUP to locate the corresponding value on the other table and place a cell's value in a different table by reference of Employee. Sorting the sheet before a lookup can help tremendously and set Range Looup to False.
=VLOOKUP(lookup_value,table_array,col_index_num,range_lookup)
For returning multiple values see this article from Microsoft.
Related
I'm new to Excel so I'm sorry if this is newbie question.
I have one excel file with about 30 sheets containing sales for each day of the month for particular products. These sheets are named like "01.01.2022", "02.01.2022", "03.01.2022" and so on.
They are formatted like this
| productID | totalSold|
| --- | --- |
| 0 | 120 |
| 1 | 14 |
| 2 | 300 |
From these multiple sheets I need to add their totalSold values to an existing table that is formatted like this
productID
01.01.2022. expected
01.01.2022. sold
02.01.2022. expected
02.01.2022. sold
03.01.2022. expected
03.01.2022 sold
...
0
120
[dataFromOtherSheet]
110
dataFromOtherSheet
100
dataFromOtherSheet
1
14
[dataFromOtherSheet]
20
dataFromOtherSheet
10
dataFromOtherSheet
I already have data for "[date] expected" column.
Values in each row for "[date] sold" columns are sum of sales for that product in a given day.
I need to combine data from for example sheet called "01.01.2022" which containes all sales and place those values into column called "01.01.2022 sold". Their productID columns need to match and they are not in the same order in every sheet so I can't just use copy/paste, plus there are a lot of data so it's imposible. All tables in those sheets have same columns, only order of products is different that order in this existing table which contains expected and sold columns.
If I've understood right your problem you have to use summifs formula.
Assuming your items code are in A column and your item price are on B column you could write :
=summIfs('01.01.2022'!B:B;'01.01.2022'!A:A; A1)
I have an inventory table that looks like this (subset):
part number | price | quantity
10115 | 14.95 | 10
1050 | 5.95 | 12
1074 | 7.49 | 8
110-1353 | 13.99 | 22
and i also have another table in sheet 2 that looks like this (subset):
part number | quantity
10023 | 1
110-1353 | 3
10115 | 2
20112 | 1
I want to basically subtract the quantities in the second table from the ones in the first table. What is the best way of doing this? I have looked in to VLOOKUP and INDEX MATCH but they are not quite right for this. Would this perhaps actually be better in say an Access DB ?
I have add another two columns next to sheet 1 last column. Let us assume that the second table range is A1:B5.
Image:
Formulas:
Column D:
=IFNA(VLOOKUP(A2,Sheet2!$A$2:$B$5,2,FALSE),0)
Column E:
=C2-D2
If you wanted to tackle this using MS Access, the SQL code might look like this:
select
t1.[part number],
t1.price,
t1.quantity - nz(t2.quantity, 0) as qty
from
inventory t1 left join table2 t2 on t1.[part number] = t2.[part number]
Here, I assume that you have a table called inventory and a table called table2 (change these to suit your database).
A left join is used to ensure that all records from inventory are returned, regardless of whether a match is found in table2, and the Nz function is used to return 0 for records for which there is no part number match in table2.
i have two columns one for Employee's names and i have another columns it is also Employee's names but with some added text , it is like this :
A B C
Emplyee's Name Emplyee'Name Emp.Code
--------------- ------------
Rima Khaled Manal Gorge Fadel 20
Manal Fadel Hib Omar 30
Hiba Jamal Rima Osamah Kahled 40
suppose i have a range named (EmpList) For B and C
how can i use a vlookup or VBA Macro to get an Emp.Code For each Similar name in Column A
If I have two tables where I have list of things in 1 table and the other table serves as a transaction table. But every time I do a transaction the value of units in the transaction should be subtracted from the lists table. Can anyone please help?
Let's say table 1 looks like this:
A B C
1 Item Start Value Current Value
2 ---- ----------- -------------
3 1 20
4 2 100
5 3 95
and table 2 has transactions recorded as a list of Item numbers in column E and associated value movements in column F, then the formula in C3 should be:
=B3-SUMIF(E:E,A3,F:F)
This formula can then be copied down for the other entries in table 1
I've been stuck for some time trying to match up two different data spread sheets. I'm trying to match off dollar amounts with matching names that correspond to the dollar amount. I went ahead and assigned unique identifiers to each row thinking that would help me match off the amounts, but my problem comes when there are two or more dollar amounts that are the same and have the same name.. is there anyway to get the second id to show up?
Formula sheet: (I need The second 112 to pull 113.. anyway thats possible??
A B C D E F G
IDSheett2 IDsheet1 NameSheet1 NameSheet2 Item AmountSheet1 AmountSheet2
554 112 Jim Jim Hat 25 25
555 112 Jim Jim Shoe 25 25
Formula in column B2: it should go through both sheet 1 and 2 and automacially fill in the matching id - id that matches the name and amount.
=IFERROR(INDEX(sheet1!$C$2:$C$1000,MATCH(1,INDEX((sheet1!$A$2:$A$1000=D1)*(sheet1!$B$2:$B$1000=G1),0,1),0)),"")
Data from Sheet2:
A= ID B= Name C= Item Name ( ID basically row 1 = 1, 2 = 2.. )
A B C D
554 Jim Hat 25
555 jim Shoe25
Data from Sheet1:
A= name B= amount C= assigned ID ( ID basically row 1 = 1, 2 = 2.. )
A B C
Jim 25 112
Jim 25 113
I'm also open to other ideas. Thanks for the help.
UPdated::: Based on comments
im not trying to create a database.. i have two sets of data that i'm trying to compare and match off like items(i take matched items and email it out to a group of people). i had to change some of the names because this is work related but the overall concept should remain.
it is Impossible for me to know how many names will be on incoming wires and how many names will be on my expected wires lists. I assigned unique ids per row on each page so i can do iferror/index/match to pull from a unique row to the main page.
What im trying to accomplish:
I have two sets of data: Sheet1 is incoming wires (it gives me a name and an amount) Sheet 2 is the account name, Item its for, and expected amount.
I'm trying to match the name and amount on the formula sheet but i run into the problem of two items with the same name and the same amount only pulling the first ID number it runs into and this becomes a problem because i have another vba code that will delete multiple ID's so i know i'm not counting something twice.
my final page should read:
ID sheet2 IDsheet1 Name Item(sheet2) Amount
554 112 JIM Hat 25
555 113 JIM Shoe 25
but right now the 113 id wont pull and it will just be 112 twice (which will end up getting deleted so i will miss that second match)
..+ everything works perfectly unless there are two items for the same name and the same amount +.. that is the only time i run into this problem.
Is there any code or process that can have the sheet realize that it has already used the ID of 112 once and then automatically fill in the id of 113 (so it won't get deleted by my vba code)?
In your formula sheet, B2 and copied down:
=IFERROR(INDEX(Sheet1!$C$2:$C$1000,MATCH(1,INDEX((Sheet1!$A$2:$A$1000=D2)*(Sheet1!$B$2:$B$1000=G2)*(COUNTIF(B$1:B1,Sheet1!$C$2:$C$1000)=0),),0)),"")