Correcting a data list in Excel - excel

At some point, approximately 2,000 rows out of a total of 15,000 rows of data got messed up in Excel, and we only noticed it much later. We now have the correct data, and want to update only the incorrect 2,000 rows.
We have Sheet 1 with 15000 rows and Sheet 2 with 2000 rows, each with Columns A and B. In both Sheets, Column B will match, but Column A will only have approximately 2000 matches.
What I am looking to do is update Column A of Sheet 1 with the correct data from Column A of Sheet 2 based on matched data in Column B from both sheets.
Presumably, a VLOOKUP is the way to go, but I can't seem to get the syntax right. Any help would be greatly appreciated!

I've fixed it!
Truth be told, I gave up on using a VLOOKUP and used INDEX & MATCH instead. The actual formula I used was:
=IFERROR(INDEX(Sheet2!A:A,MATCH($E2,Sheet2!$C:$C,0)),D2)
Since I was trying to match data in one column and fetch data from a different column in the results, this seemed simpler.
Apologies if I wasted anyone's time!

Related

Matching mulitple criteria across 2 sheets and pulling some data from that match in excel

I have two sheets of data, one is a list of 4000+ companies and some data about the company (including a CUSIP and an issue date). The other lists stock prices per day for a said list of companies spanning multiple years.
I need to match the CUSIP and the issue date from the first sheet with that of the second and extract a number from sheet 2 where both where a match and put it in sheet one in a colomn next to the other data from that company.
Sheet 1
Sheet 2
I tried =VLOOKUP(E1076&O1076;Sheet1!A:Sheet1!K;11;FALSE) but all this did was give me a #NAME error same for when I tried to do this on the same sheet
I tried =INDEX(W:AP,MATCH(1,(X:X=D5)*(AE:AE=N5),0),42) but that just tells me it isn't a formula to begin with
Combined Sheets
In Column R:
{=INDEX(AG,MATCH(D2&N2, U&AB,0))}
will work for you but will likely be slow (make sure to enter with ctrl+alt+enter)
You can try and mitigate the lag by using defined ranged (e.g. U2:U4000&AB2:AB4000) but since your list is ever growing I'll guess that the lag will come back pretty quick.
To keep things faster, I suggest you use a helper column where you concatenate U and AB. Let's say column AC:
=U2&AB2
(copied all the way down)
You can then use a simple INDEX/MATCH:
=INDEX(=INDEX(AG,MATCH(D2&N2, AC,0))
You could also concatenate D and N to another column and use that column as your lookup value.

Get all rows from a sheet, into another sheet, where each row contains a cell matching a certain value

I'm looking for a solution without VBA due to work limitations.
The schema of my sheet is as follows:
SheetName: 'Spend Track'
Row 4 - headings
A B C D E F G H I J
Date, Originator, Supplier, Description, Receipt, Type, Account, Gross, GST, Net
Row 5 onward is data.
In another sheet (called Kevin); I want all the rows from Spend Track! that
match the condition Bx='Kevin'. Where x= the given row number.
So if Spend Track has 10 rows, 3 of which belong to Kevin. The sheet Kevin will have 3 rows and will update when new rows are added in Spend Track.
Thanks!
The main problem is to get a list going in Kevin of the row numbers you need. Following the hint of Tim Williams, here is a way. In some work column of the "Kevin" sheet (that can be hidden later if needed), where I will use column "A", create a column starting in row 4 (or put a header in row 3, first), to keep things simple, that says in its top filled in cell, =if('Spend Track'!B4="Kevin",row(),1000000), where a million is comfortably bigger than the number of rows in the first sheet will be. This gives you a column of either the row numbers with Kevin in them (your x's) or a million.
Now in another work column parallel to the first, B in my example, but not needing to be quite as long, starting in the same row, do, and drag down, =small(A$4:A,ROW()-3), and presto, you get a list of the row numbers with Kevin in them, followed by millions.
Once you have the row numbers, INDEX, will do the rest. Where you want your outputs to begin, put in =index('Spend Track'!A:A,$B4), drag right until it becomes =index('Spend Track'!J:J,$B4) and down as many rows as you can imagine wanting matches.
This will give you all the desired rows.
On a Google Sheet, the references beyond the end of Spend Track leave things blank, but it appears that in Excel you will get a row of unsightly 0's. If that is so and it bothers you, the formula can be adapted to =if($B4=1000000,"",index('Spend Track'!A:A,$B4))
That should do it.

Complex N columns Per x rows Transpose

I have an excel dataset with a rows and 5 columns per row.
I need to transpose so that all data is in rows with just two columns:
each row must have Column 1 from the dataset in its column 1 and each of the columns 2-5 in the dataset as its column 2, when those are exhausted row 2 of the dataset is processed in the same way. This would result in each row in the dataset creating 4 rows in the transposed set.
To better explain I have added in some screenshots of what I mean.
unfortunately i cannot access VBA or macros on our machines so it needs to be a formula.
Sorry posted before I'd completed the question:
I have tried using a variation of =row() and =column() to try to count columns and then move to the next row when column number is more than 5 but I'm struggling to work out the logic that would work.
I've also toyed with =index with the entire dataset as an array and use some calculations to give the function the pointers to the row and column to next display.
But as an array its pretty slow when dealing with 10,000 records (and I still haven't worked out what logic I would use).
You are on the right track with Index and Row
In you unpivot sheet, use
A1
=INDEX(Source!$A:$A,INT((ROW()-1)/4)+1)
B1
=INDEX(Source!$B:$F,INT(ROW()-1)/4+1,MOD(ROW()-1,4)+1)

Finding last column value for 1000+ different sized columns (excel)

I have data that has different number of rows per column, and I have about 1000+ columns. I need the last value of the column, that would be my closing price then. But I have tried almost everything and I get zeros or I get the same values repeated! I am using Excel 2016
Maybe I'm lazy but I do not want to do this manual D:
What I have tried:
=LOOKUP(2,1/(A:A<>""),A:A)
=INDEX(A:A,COUNT(A:A))
And everything else that I could find online!
About the data: The column vectors contain numbers that are larger than zero, and there are no empty cells in between.
Does anyone have a suggestion?
This question was solved!!! See the comments for the answer

Sum the product of multiple vlookup or index/match results

I have 2 worksheets, one with multiple columns of data where rows are given years and the other columns are values under the headers of names, and the second sheet lists rates by year (column) and by name (row).
I am trying to take each value in a given column of sheet1 and multiply it by the relevant rate (found by matching the year of each row and the name of its column to the table in sheet2) and then sum the products by name, but can only use a single cell to do all this.
So far I've tried SUMPRODUCT and got to =SUMPRODUCT(O$24:O$514,INDEX(Rates!$A$2:$X$200,MATCH(O$23,Rates!$A$2:$A$67,0),MATCH($D$24:$D$514,Rates!$A$2:$X$2,0))) but this seems to fall down at the MATCH($D$24:$D:$514,Rates!$A$2:$X$2,0) part, even entering as an array.
I've currently resorted to a clumsy series of SUMIF(2016)*INDEX/MATCH(2016 rate)+SUMIF(2015)*INDEX/MATCH(2015 rate) etc, but would really like to have forward compatibility without relying on formulae being updated!
slightly simplified image of the workbook, thanks for any help!

Resources