I have two worksheets, both have a column called part number. I need to find only the rows from both sheets that are unique. So if sheet one has:
part number
------------
abc
def
ghi
jkl
and sheet 2 has:
part number
------------
abc
def
ghi
zzz
I need the results to be:
jkl
zzz
You could copy both lists to be in the same column and then advanced filter for unique values
in sheet #3 column A paste the following
=IF(ISERROR(VLOOKUP(Sheet2!$A1,Sheet1!$A$1:$A$4,1,FALSE)),Sheet2!$A1,"")
and in sheet #3 column B
=IF(ISERROR(VLOOKUP(Sheet1!$A1,Sheet2!$A$1:$A$4,1,FALSE)),Sheet1!$A1,"")
that will list values from sheet1 not found in sheet2 and vice versa.
hope that helps
A formula of this kind in each sheet (copied down to suit) should identify uniques with #N/A:
=MATCH(A2,Sheet4!A:A,0)
Related
I have 2 excel spreadsheets in a single excel file. Both of these files have a Campaign Name column and sum_revenues column
My first problem is that I want to match the Campaign Name column in both the sheets and if they match then I want to add the sum_revenues value in the 1st spreadsheet to sum_revenues in the 2nd spreadsheet
I know that sumif or sumifs will be used but I do not know how I can apply them.
The output should be the addition of sum_revenues column in both the sheets based on the Campaign name matching criteria in the sum_final column which is present on the 2nd sheet.
I hope I am clear about the question but please let me know if there is any confusion.
Below is how sheet 1, Sheet 2 looks like.
Sheet 1:
Campaign Name sum_revenues
ABC 40
DEF 60
Sheet 2:
Campaign Name sum_revenues sum_final
ABC 30 70
GHI 10 0
Now please note that in Sheet 2 in which I want to output is that sum_final column has the sum_revenues added up from both the sheets because ABC is present in both the sheets and it should show 0 for those which do not match.
Try:
=IFERROR(VLOOKUP(A2,Sheet1!$A$2:$B$3,2,FALSE),0)+B2
Sheet 2 Images:
Below formula may help you, assuming that your sheet1 data available in column A & B and sheet 2 data available in Column D & E and finally F would be the result.
Type the formula
sumif(e:e,d:d,a:a)+sumif(a:a,d:d,b:b) +e3
I want to match three different columns in different sheets in Excel.
In one sheet I have Group and Name, and in another I have Name and Email.
How do I match Name in Sheet 1 with Email in Sheet 2?
Sheet 1
Group Name
A John
B Jack
C Anne
Sheet 2
Name Email
John john#
Jack jack#
Anne anne#
In Sheet2 column C, add a Group with this formula copied and dragged down:
=INDEX(Sheet1!$A$2:$B$4,MATCH(A2,Sheet1!$B$2:$B$4,0),1)
See the pic above. This should give what you are looking for.
I asked a very similar question to this one here, but I am trying to identify if a cell's numerical value is contained in a list of cells on a different sheet. If the cell from sheet A matches a cell in sheet B, mark a different column in B with a corresponding row in sheet A, otherwise leave it blank. An example is below:
Sheet A
Column A | Column B
-------------------
1 John
2 Sue
4 Bob
I would like the corresponding Sheet B to populate Column B like this:
Sheet B
Column A | Column B
-------------------
2 Sue
3
4 Bob
=IF(ISNUMBER(MATCH(I2, 'SALT, WOD, Champion Members'!A:A, 0)), "Y", "N")
I have been using the above answer to populate a different column in the same workbook, and I'm thinking I can maybe use this formula, but instead of "Y" or "N", somehow preserve the row.
You need to use VLOOKUP as already mentioned. But you will need to use another function to check for existence of the value, else you will get #N/A against ID 3
I used COUNTIF
=IF(COUNTIF($A$2:$A$4,E2)=0,"",VLOOKUP(E2,$A$2:$B$4,2,FALSE))
Use the VLOOKUP function:
=VLOOKUP(A1;Sheet1!A:B;2;FALSE)
Where A1 is the value you want to look up, Sheet1!A:B is the original sheet with the data.
I'm working with 3 worksheets.
PROJECTS consists of the following:
Project ClientCode Code
------ ---------- ----
Project1 ABC 123
Project2 ABC 456
Project3 DEF 789
INVOICES consists of:
ProjectCode Amount
----------- -----
123 $100
789 $200
123 $50
And CLIENTS consists of:
Code Total
---- -----
ABC [$150]
DEF [$200]
I'm trying to create a formula which will populate the "Total" field on the client sheet by determining which invoices belong to which project belong to which client. I feel like it would be a combination of SUMIF and LOOKUP, but I'm stumped.
EDIT: Revised the above to the format discussed below (swapped Projects column B and C)
Using VLOOKUP and SUMIF in a single cell without any helper column is possible, but you will need to interchange the positions of columns ClientCode and Code in PROJECTS for it to work.
Interchange the column positions as mentioned above (so that ClientCode is before Code), then use:
=SUMIF(INVOICES!A:A, VLOOKUP(CLIENTS!A2, PROJECTS!B:C, 2, 0), INVOICES!B:B)
I'm assuming that row 1 of each worksheet has the column headers. A2 here refers to ABC.
VLOOKUP first looks for the Code of the ClientCode and SUMIF then sums the amounts of matched Code in the INVOICES worksheet.
EDIT: Below should work better since VLOOKUP finds only the first match, which doesn't work here.
=SUM(SUMIF(INVOICES!A:A,IF(CLIENTS!A1=PROJECTS!C:C,PROJECTS!B:B),INVOICES!F:F))
Note that you have to use Ctrl+Shift+Enter to use this formula. After you did it for ABC, you can drag the formula to B. Also note that his formula can take some time to evaluate, and as such, it might be better if you change the ranges to an appropriate range. For example, if INVOICES has only 100 rows, change INVOICES!A:A, INVOICES!B:B to INVOICES!A2:A100, INVOICES!B2:B100, same goes for the other ranges in this formula.
I'm trying to make a macro that will go through a spreadsheet, and based on the first and last name being the same for 2 rows, add the contents of an ethnicity column to the first row.
eg.
FirstN|LastN |Ethnicity |ID |
Sally |Smith |Caucasian |55555 |
Sally |Smith |Native American | |
Sally |Smith |Black/African American | |
(after the macro runs)
Sally |Smith |Caucasian/Native American/Black/African American|55555 |
Any suggestions on how to do this? I read several different methods for VBA but have gotten confused as to what way would work to create this macro.
EDIT
There may be more than 2 rows that need to be combined, and the lower row(s) need to be deleted or removed some how.
If you can use a formula, then you can do those:
Couple of assumptions I'm making:
Sally is in cell A2 (there are headers in row 1).
No person has more than 2 ethnicities.
Now, for the steps:
Put a filter and sort by name and surname. This provides for any person having their names separated. (i.e. if there is a 'Sally Smith' at the top, there are no more 'Sally Smith' somewhere down in the sheet after different people).
In column D, put the formula =if(and(A2=A3,B2=B3),C2&"/"&C3,"")
Extend the filter to column D and filter out all the blanks.
That is does is it sees whether the names cells A2 and A3 are equal (names are the same), and whether the cells B2 and B3 are equal (surnames are the same).
If both are true, it's the same person, so we concatenate (using & is another way to concatenate besides using concatenate()) the two ethnicities.
Otherwise, if either the name, or username, or both are different, leave as blank.
To delete the redundant rows altogether, copy/paste values on column D, filter on the blank cells in column D and delete. Sort afterwards.
EDIT: As per edit of question:
The new steps:
Put a filter and sort by name and surname. (already explained above)
In column E, put the formula =IF(AND(A1=A2,B1=B2),E1&"/"&C2,C2) (I changed the formula to adapt to the new method)
In column F, put the formula =if(and(A1=A2,B1=B2),F1+1,1)
In column G, put the formula =if(F3<F2,1,0)
In column H, put the formula =if(and(D2="",A1=A2,B1=B2),H1,D2) (this takes the ID wherever it goes).
Put the formulae as from row 2. What step 3 does is putting an incremental number for the people with same name.
What step 4 does is checking for when the column F goes back to 1. This will identify your 'final rows to be kept'.
Here's my output from those formulae:
The green rows are what you keep (notice that there is 1 in column G that allows you to quickly spot them), and the columns A, B, C, E and H are the columns you keep in the final sheet. Don't forget to copy/paste values once you are done with the formulae and before deleting rows!
If first Sally is in A1 then =IF(AND(A1=A2,B1=B2),C1&"/"&C2,"")copied down as appropriate might suit. Assumes where not the same a blank ("") is preferred to repetition of the C value.