Excel Compare Cells Between Workbooks - excel

I would like to create a macro that compares cells within Column E and if they are found to be matching then it would check/compare the date fields in Column H and the oldest date the macro would mark "yes" in Column R.
I'm newer to excel and not sure how to do this.

Assuming that you are creating a formula on Book1 to compare to Book2, then put this formula in Book1, Column R
=IF(E1=[Book2]Sheet1!E1,IF(H1=[Book2]Sheet1!H1,"yes",""),"")
Obviously you would need to change the Book Names and Sheet Names.
What did you mean by "Oldest Date"?

Related

Checking whether a date is earlier than the dates in a range in Excel

I have two sheets in an Excel file, Sheet A and Sheet B. In each, Column A is dates, and Column B is email addresses. Some of the dates in Sheet B are blank. In Sheet B, at the top of Column C, I have the following formula:
=IF(LEN('Sheet B'!A2)=0,COUNTIF('Sheet A'!$B$2:$B$2642,'Sheet B'!B2),COUNTIFS('Sheet A'!$B$2:$B$2642,'Sheet B'!B2,'Sheet A'!$A$2:$A$2642,<='Sheet B'!A2))
Excel is saying there's a problem with my formula. I'm 99% sure the problem is with how I wrote the very last condition in there: 'Sheet A'!$A$2:$A$2642,<='Sheet B'!A2, specifically the part after the comma. Unfortunately, I have no idea why that's wrong or how to write it correctly. Any help?

How to return the entire row based on two cells from two different Excel sheets matching?

I have a large Excel data file, with data from two different sheets. I want to be able to match the partner_identifier values from SO Sheet 2 to the values in BB Sheet 1. For the rows in BB Sheet 1 that do match, I want to bring the entire row into a new sheet.
I need help coming up with a formula for this. I've tried VLOOKUP and IF variations, but I think I need a more complex formula. I can't do an =IF('SO Sheet 2'!D3='BB Sheet 1'!D3) because the matching values could be in different rows.
Right now, I have (and I know this is off because it returned "No" for every row, even the ones with a matching value) :
=IF(D3='SO Sheet 2'!D3:D16,'BB Sheet 1'!D3,"No")
Any insight would be greatly appreciated!
If you are using latest version of excel (Excel for Microsoft 365) - you can use XLOOKUP or FILTER formula.
Example:
= FILTER('SO Sheet 2'!A3:D16, 'SO Sheet 2'!D3:D16=D3)
Check here for details about these formulas: XLOOKUP, FILTER
You can achieve the result in 2 steps. in Sheet "BB sheet 1", you need to add a column E with XLOOKUP formula to find the matching identifier in "SO sheet 2"
=XLOOKUP(D2,'SO Sheet 2'!$A$2:$A$14,'SO Sheet 2'!$A$2:$A$14,"No")
The above will list all the matching identifier and put "No" wherever if couldn't match the identifier.
Then all you got to do is , in a new sheet, enter the formula in cell A1
=FILTER('BB sheet 1'!A:D,'BB sheet 1'!E:E<>"No")

Need help in excel to perform 4 cell lookup and copy in VBA

I have found VLOOKUP and it does not seem to match all of the criteria I need to perform.
The following is what has stopped me at this time. I would appreciate any assistance.
in excel, I need to match a value from a specific cell in spreadsheet A, column B, with a range of values in spreadsheet B, column C. Then in the row that the value in spreadsheet B is found, I need to obtain the value for the cell in column P and copy it into spreadsheet A column N.
Thank you,
While VLOOKUP has its uses I would always recommend using the INDEX function instead as you are not limited by using the leftmost column.
I think the type of formula you are looking for is (to be put in column N of spreadsheet A):
=INDEX('[Spreadsheet B]Sheet1'!P:P,MATCH(B1,'[Spreadsheet B]Sheet1'!C:C,0))
This would match the specific cell of B1 in Spreadsheet A with a value in column C in Spreadsheet B and then give provide the value in column P of the corresponding row. Obviously you should change out 'Spreadsheet B' with the name of your workbook and 'Sheet1' for the name of the worksheet in Spreadsheet B.

Comparing two columns in excel, returning data into another cell

I need help creating a formula in Excel 2010.
I have two worksheets - one that is a detail tab that is populated quarterly (Worksheet1), and the other one is a summary tab (Worksheet2).
In Column A of both worksheets I have a list of names. The formula needs to compare the names and if there is a match, Column E of Worksheet 2 needs to be populated with the data in Column C of Worksheet 1.
Please help - I have been banging my head on my desk all morning trying to figure this out.
Thanks.
In column E of sheet 2, use a conditional expression. For example, for row 1:
=IF(A1 = Sheet1!A1, Sheet1!C1, "" )
Copy this formula to every row of column E.

Count if two criteria match - EXCEL formula

I have this table and I would like to create a formula which would count values based on true conditions from column A and column C.
Example:
If in column A value is M (male), and in column C is YES, then it would count.
could anyone help me with this formula?
Add the sheet name infront of the cell, e.g.:
=COUNTIFS(stock!A:A,"M",stock!C:C,"Yes")
Assumes the sheet name is "stock"
If youR data was in A1:C100 then:
Excel - all versions
=SUMPRODUCT(--(A1:A100="M"),--(C1:C100="Yes"))
Excel - 2007 onwards
=COUNTIFS(A1:A100,"M",C1:C100,"Yes")

Resources