VLOOKUP and Record Count Excel - excel

Two spreadsheets: Spreadsheet 1 and Spreadsheet 2
I am trying to find out which records in spreadsheet 1 exist in spreadsheet 2 (Currently basing it off a single column)
I am doing a v look up to match two columns of data. After the match, I want to do a record count to count how many of the same matches it found (displayed in another column)
Here is a my vlookup formula
=VLOOKUP('[Spreadsheet1.xlsx]Complete'!$B:$B,Y:Y,1,FALSE)

If I understand your question, for each row in Spreadsheet 1 you want to return the number of times the key of Spreadsheet 1 appears in Spreadsheet 2. This will give you how many times what's in cell B1 appears in column Y:Y:
=COUNTIF('[Spreadsheet2.xlsx]Complete'!$Y:$Y, $B1)

I'm assuming you're attempting to determine whether or not some unique value like an ID exists in both Spreadsheets 1 and 2. What I would do is add a column to both to check the other for the existence of the value with something like this:
For Spreadsheet 1
=IF(ISERROR(MATCH(B1, '[Spreadsheet2.xlsx]Complete'!$B:$B, 0)),"",1)
For Spreadsheet 2
=IF(ISERROR(MATCH(B1, '[Spreadsheet1.xlsx]Complete'!$B:$B, 0)),"",1)
For the MATCH function, if there is a match it returns the row number of the match, if there is no match it returns an error. This formula will add a 1 to the column if there is a match and leave the cell blank if there is no match. Take the sum of this new column get a match count in each sheet.

Related

VBA to find the last value in a row greater than 0 then return the header of that column as the value

I have a spreadsheet which has over 1000 rows of data. Column A consists of names and Row 1 has dates going across the top of over 500 columns.
I have another sheet which is a copy of column A and I want to put the date of the last entry of data that is greater than 0 into column B.
I want to do the following:
Find the last cell in each row that is greater than 0 (starting from the second row up to the 1500th row)
Then I want to have the date of that entry listed into column B of another sheet where I have the same names listed.
I'm completely stuck with this. I have tried to get VBA and formula's to work but I can only seem to get them to bring up the value of the last cell and not the date of the entry. An exmaple of one formula is below:
=LOOKUP(2,1/('Sheet1'!B2:ARJ2<>""),'Sheet1'!B2:ARJ2)
Hopefully, I would like a VBA solution, but I will take any solution right now!
Thanks,

Find the header row where the last occurence of a value appears in sheet

So I have 2 excel sheets where one excel sheet (say Sheet 1) contains some values and dates corresponding to those values. Header row contains the date and rows 2 to 6 contain the values. The other sheet (say Sheet 2) contains the list of all values that were entered in rows 2 to 6 of Sheet 1.
Sheet 1 usually gets updated in such a way that new records are added per column. For example, Sheet 1 has 3 new records, so columns B, C, and D are filled. I then want to retrieve the last occurrence of a certain value from Sheet 1 and record that last occurrence in Column B of Sheet 2. The last occurrence of that value occurs in, say cell D5 of Sheet 1, and I want to return the content of cell D1 in Sheet 2. If that value occurs again in cell F3 after another update, for example, cell F1 will be returned. A sample image is shown below, with the contents of Sheet 2 merged under the contents of Sheet 1.
Sample problem
What could be a possible formula for this? I have been trying to find possible formulas but all those solutions involve only one column or row as scope and not the whole sheet.
So far, what I'm only able to do is to return the index of the last occurrence of a certain value in just one column. See photo below.
Index of last occurrence of value sample
Thanks in advance for the help!
The images you added show two different situations: the first one (Sample problem) has the dates on the first row and the second one (Index of last occurrence of value sample) has the dates on the first column. Still, I believe that the solution I'm proposing will work in both scenarios.
If you already figured how to get the column / line number, you can use the INDEX function to return the value at the first line / column.
For image #1:
= INDEX (1:1; 1; <your formula here>)
For image #2:
= INDEX (A:A; <your formula here>; 1)

Excel - look for value in column then count number of occurrences in corresponding row

I have two sheets that both share the same unique identifier (listed in a column). Sheet 1 contains the raw data and on sheet 2 I am extracting key figures and making calculations.
In sheet 2 I would like to add a count of the number of times a word, say "Apple", appears in sheet 1 in the row that corresponds to the same ID. So it's a formula looking up the ID in sheet 1 and then counting the number of times "Apple" appears in that row.
I couldn't find a solution to this anywhere, so I would be grateful for any help!
You can use this formula:
=COUNTIF(OFFSET(Sheet1!$1:$1, MATCH(A1,Sheet1!A:A,0)-1, 0), "*Apple*")
This supposes your ID column in sheet2 is column A, it will count the occurrences of Apple where the row matches the id in sheet1 cell A1. You can type it at any cell in first row and copy down in the column.
Also, if you want to match whole cell content for "Apple", you can remove the wildcards from "*Apple*".

Excel - Search Sheet 1 using a list from Sheet 2

I have 2 sheets in Excel.
Sheet 1 contains a Column of Order Numbers amongst other things
Sheet 2 contains just a Column of Order Numbers.
I would like to search Sheet 1 for all of the order numbers that are contained in Sheet 2 and then either Highlight the matching order numbers or delete the entire row from Sheet 1 in which the matching order number was found.
I think this maybe possible using VLookUp?
This can be done without VBA:
use index/match or vlookup to find the the order numbers
filter the rows of Sheet 1 in order to see just the rows which are not found in Sheet 2 (depending on your formula, this could be Blank values, N/A, etc)
delete all rows where the lookup returned no match
Excel INDEX and MATCH Get Value

Filter data in one column based on data in other column

How can I find duplicate records using their Item Number and copy/extract Unit Price?
You can use a vlookup to find when an item matches another item in a different column. For your example, assuming that row 20 column F contains the item 52F233, use this formula for cell I20
=VLOOKUP(F20,$G$1:$H$1000,2,FALSE)
This will put the unit price in cell I20 when a match is found and #N/A otherwise. You can paste this formula in the entire I column and it will show you when the match is found for each entry. After that, you can sort the ones with a valid match and take the next action you need with the matched data, such as add to a different sheet. The vlookup formula cna be used across multiple files.

Resources