I have two tables. First table has two columns: ID and Name. And in the first table are all IDs and names.
Second table also has two columns: ID and Name. But this table does not contain all IDs and names.
I want to do this: when I enter an ID in the second table in column ID, I want to automatically pick up the name from the first table of that ID and print it in column Name on the second table.
Also, I know to do this for just one row. For example:
=VLOOKUP($B1; TABLE1!A:B; 2; FALSE)
But I want to do this for whole column ID in the second table.
How can I do this?
You can use vlookup formula with Array..however in any case you have to paste the formula in next cell in order to get it worked.
Related
I'm looking for a formula that would allow me to extract rows from a table where the value in the first column is equal to a reference?
See the table below:
If the value in the first column is equal to 13:00:00, as it is on the right of the pic, extract the relevant row onto a new table. I have attached the spreadsheet to play with.
https://www.mediafire.com/file/eaz7no3263vl3sd/Table.xlsx/file
Just FILTER the range against the reference value:
https://support.microsoft.com/en-us/office/filter-function-f4f7cb66-82eb-4767-8f7c-4877ad80c759
Let's say I have a table of First/Last names and Salaries.I want to compute, for every last name, the sum of the salaries of people with that name.
I know how to do that for each name individually using SUMIF, but I was wondering if there is a quick function to produce a table of Last names and Salary sums?
Another option would be using a pivot table.
On the insert tab, select pivot table
Use your existing table as the data
In the fields select the Last Name and Salary columns
Let's support you have the salary sheet in sheet1 as below,
copy column last name value to sheet2.column A, remove duplicate, add a new column as Salary Sum in column B, input a formula as =SUMIF(Sheet1!B:B,Sheet2!A2,Sheet1!C:C) and drop down to all rows, then you can got a salary sum table as below,
of course, if the first name/last name is dynamic and unexpected, it would doesn't work. you can drop a button and bind a VBA code to handle it.
You could use this ARRAY FORMULA: CTRL + SHIFT + ENTER
=IFERROR(INDEX($A$2:$A$7,MATCH(0,COUNTIF($D$1:D1,$A$2:$A$7),0)),"")
For summing up the corresponding values just use
=SUMIFS($B$2:$B$7,$A$2:$A$7,D2)
Im doing a check for the value in C2 in a table (call it M1table), using this part of the formula:
(C$2=M1table)
Whole formula:
=RIGHT(INDEX(M1table,(SUMPRODUCT((C$2=M1table)*ROW(M1table))-ROW(M1table)),20),1)
How do I specify columns instead of checking the whole table? Unfortunately I don't have named columns, is there a way to do it with column number (look for value of C2 in 2nd to 8th column)? If using column names is the only way, I can name them.
Thank you
If M1table is a real Excel table, then the column header is the name and you can reference like M1table[colName]
If M1table is just a range, and not a real table, then you can use the INDEX function to reference a single column. eg: for the 2nd column in the table:
C$2=INDEX(M1table,0,colNumber)
For columns 2-8 you could use:
=$C2=INDEX(M1table,,2):INDEX(M1table,,8)
Can I get the Excel code for if 2 rows have equal Timestamp, Last Name and First Name, copy the Company Name from the first row to the second row?
In the example below, only the first and second rows match, so the Company Name in the second row should be populated with Company A
How about you try the following to see if it works out for you:
=IF(A2&B2&C2=A3&B3&C3;D2;"")
I have a data table with 8 columns and i want to know if anyone can help me come up with a formula to get the name in the first column if i enter a value into the columns (3,4,5,6,7,8).
I want the name from the first column to appear in another table on another sheet where only names appear where data is in the columns (3,4,5,6,7 & 8)
Try this:
=IF(OR(Sheet1!C2<>"";Sheet1!D2<>"";Sheet1!E2<>"";Sheet1!F2<>"";Sheet1!G2<>"";Sheet1!H2<>"");Sheet1!A2;"")
You can use C1 = 1 .... if you prefer.
And C1,D1,E1... have to be replaced with your columns.
Also Sheet1 have to replaced with your sheet name
I would use a Pivot tables.
First create a new column in the existing table:
If you only having positive values then it is:
=sum(C2:H2)
If you have zero and negative values as well it would be like this:
=IF(COUNTBLANK(C2:H2)=6;0;1)
Then make a pivot table with the "TO/TA name" in the Row Labels and the new column in Report filter - where you then removes the "0".