I want populate cell by looking up data in another sheet - excel

I have an Excel workbook with 2 sheets.
I want to use Sheet 1 as the source to populate a column in Sheet 2.
Sheet 2, Column B has a list of resource names
Sheet 1, contains many of the same names in Column A, and a list of managers in Column F
I want to populate a separate column in Sheet 2 with the managers name from Sheet 1 based on matching the resource names.
I want to get a result of NOT FOUND if names don't match
I've tried
IFERROR(VLOOKUP(B8,'SHEET 1',!$A$3:$AR:100,6,FALSE),"NOT FOUND"), but this formula always returns "NOT FOUND" even though there are matches in Sheet 1

Looks like the ranges in your vlookup are a little wonky, e.g., 'SHEET 1',!$A$3:$AR:100
To be a little more straighforward, let's give you an index/match formula, so you can more easily specify the search array from the output array:
=IfError(Index(Sheets1!$B:$B,Match(Sheets2!B8,Sheets1!$A:$A,0)),"Not Found")
How this works is you Match() the cell on Sheets2! (B8 from your example formula) within the search array, Sheets1!$A:$A (yes, you can use a whole column which makes things a little easier). If nothing is matched, it throws an error (so if-error handles that); if it is found, then it will output (index) based on the output array, Sheets1!$B:$B.
You will want to fix the search array column and output array column to fit your scenario.

Related

Find First Non-Blank Cell With Data and Return Value on Separate Tab

I am trying to figure out a formula to find the first non blank cell with data on a separate tab from where I need the value returned. I've tried the following formula but no luck: =INDEX(Sheet2!H:H,MATCH(1,Sheet2!A:A=Sheet1!A3)*Sheet2!H:H<>"",0)
On Sheet 1 under column "Value from Sheet 2" I need the value from Sheet 2 under column H that is not blank using Sheet 1's "Name" column as the reference, in this case value "123" is the first non blank cell for name "ABC" on Sheet 2.
Thank you
In your data above, =sheet2!A$3:A$6=A3 is going to return {true;false;false;true}.
Further, =NOT(ISBLANK(sheet2!H$3:H$6)) is going to return {false;true;true;true}.
Thus, =(sheet2!A$3:A$6=A3) * (NOT(ISBLANK(sheet2!H$3:H$6))) should get you the array {0;0;0;1}, which is what you want to lead you to desired cell.
=MATCH(1, (sheet2!A$3:A$6=A3) * (NOT(ISBLANK(sheet2!H$3:H$6)))) gets you the index to the first hit, which is 4, and using that as in index into H$3:H$6 gets you all the way home.
But I’d exploit the more useful features of XLOOKUP instead and I resort to index/match only when required—which is pretty rare now that XLOOKUP exists:
=XLOOKUP( 1, (sheet2!A$3:A$6=A3) *
(NOT(ISBLANK(sheet2!H$3:H$6)))), sheet2!H$3:H$6)
One fewer functions, AND it adds the ability to handle a not-found condition.
This all should still work if you just decided to use A:A and H:H as in your previous formula.

Multiple Conditional If Statements in Excel to Return Single Value [duplicate]

I am trying to populate B2:D5 with "yes"/"No" ( Figure 1) based on the criteria that if I find the respective pvalue( Column A) , in the 'Test' column in a separate sheet and the Fvalue matches the column header of figure 1. I tried using the formula visible in figure 3. However, it incorrectly labels the cow and chicken columns. Which I suspect is due to it stopping at the first " True" value it finds, and not iterating over the other values once it finds said true value.
Use COUNTIFS()
In B2:
=IF(COUNTIFS(Sheet1!A:A,$A2,Shee1!B:B,B$1),"Yes","No")
Then copy over and down the grid.
Where Sheet1 is the list.

OFFSET / INDIRECT function trouble

I have two sheets within a workbook, the first with several thousand lines of expenses, separated by individuals, and the second a summary of totals and such.
On the second sheet, I've created a reference to the first to insert each individual's name (i.e. B4: ='Card Transactions'!D89). I'm having difficulty with the syntax for returning the total of each individual's total, which is in a predictable cell in the first sheet relative to the name (down 1, right 7).
I've tried the following:
=offset(indirect(B4),1,7) with only a reference error in return. This seems like it should be relatively simple but I'm not having any luck. . . any suggestions?
use this:
=OFFSET(INDIRECT(MID(FORMULATEXT(B4),2,300)),1,7)
note:
this only works if the formula in B4 only contains the one cell reference.
This is a volatile function and will cause a noticeable lag in calculations if used too many times.
The following should work for you as long as your data follows these rules:
Your columns have headers
The names are all in the same column
And you are able to set the range with row numbers and not just full columns
Let's say your first sheet is set out like this:
And you want your second sheet like this:
And your sheets are named:
Sheet1
Sheet2
This is the formula in B2 of Sheet2:
=INDEX(Sheet1!$A$1:$H$9,MATCH(A1,Sheet1!$A$1:$A$9,0)+1,MATCH("Column 8",Sheet1!$A$1:$H$1,0))
And here's what it does:
Your index array is the entire blue area, this can be the whole sheet but can't be a full column reference, the row number must be specified. In this example, the index array is $A$1:$H$9 and the $ signs mean the range won't move when you drag down the formula, so they are important!
Your first match finds the row number, it uses the name (in this case 'bart') as the lookup value, and the purple area as the array. In this example the row array is $A$1:$A$9 and the row numbers must match the row numbers in the index array. The match has a "+1" at the end, so it will find the matching row, then add one row down to get your offset.
Your second match finds the column number, it will need to use the name of your column. In this example the column array is $A$1:$H$1 and the column letters must match the column letters in the index array.
Let me know if this doesn't fit your problem, I'm sure we can figure it out.
Thanks.

Find Partial Matching data across two sheets

I have two excel sheets that I am working with. Sheet 1 has a 'last name' column D and sheet 2 has a 'name' column A. the 'name' column contains last,first name so I need a partial match option to find the customers last name in each sheet and create a new list using the information found in the 'name' column A from sheet 2 in another sheet. This may be simple but for someone who lacks in excel I would appreciate the help.
You could perform an INDEX MATCH function with wildcard search.
=INDEX(B:B,
MATCH("*"&D2&"*",Sheet2!A:A,0),1)
The match function will search for the partial string in cell D2. (Which would be a last name assuming D1 is the title of the column) - The "*"& part on either side of D2 searches for the partial string. If the column only contained last names, it would just be
=INDEX(B:B,
MATCH(D2,Sheet2!A:A,0),1)
After it searches for the partial string, it will search through column A in Sheet2 and find the name which matches (Lets hope you do not have duplicate names).
Once you have matched two names, in comes the INDEX function. This will obtain the corresponding value from any column you want but only in the same row as that last name.
If you want it all in another sheet, you could do.
=INDEX(Sheet1!B:B,
MATCH(Sheet1!"*"&D2&"*",Sheet2!A:A,0),1)
Maybe chuck in some error handling as well.
=IFNA(INDEX(Sheet1!B:B,
MATCH(Sheet1!"*"&D2&"*",Sheet2!A:A,0),1), "No Match or No Data")

Large excel file, I'm trying to find duplicates and copy the rest of the cells across the duplicate to the duplicate it finds

I have a large excel file, it has 65,000 parts, those part numbers are in column A. Then it has several columns of important info next to the part number (B is retail price, C is my cost, D is the weight, E description and so on until J)
I was just given a list of 16,000 new parts, they are superceeded from old parts, all the new list tells is new part number in column A and old in column B.
So what I can't figure out is how to tell excel if B65001 matches anything in column A1-A65000 then copy the information from the columns next to that A cell into the columns next to this duplicate.
I hope that makes sense?
Please help
I would:
Put the list of new parts in a new sheet (let's call this "Sheet2")
Sort this by column A (required for the VLOOKUP function)
Insert a column next to A in the original sheet
Put the formula =ISERROR(VLOOKUP($A2, Sheet2!$A:$B, 2, FALSE), $A2, VLOOKUP($A2, Sheet2!$A:$B, 2, FALSE)) in column B2 of the original sheet (the new column, and I'm assuming you have headers), and fill it down
Copy this new column and paste it over itself, but select Paste Values from the Ctrl paste options menu. This will get rid of the formula and solidify the new part number as text.
Delete the old A column and the new B column will take its place.
Delete Sheet2 if desired.
The formula in layman's terms: Excel will search for the old part number in Sheet2. If not found, it will produce an error, and just use the old number. If found, it will use the value next to the old part number on Sheet2, the new part number.
An explanation of the VLOOKUP function:
The first argument is the value to search for. In this case the value in the A column of the same row (fill-down will automatically change the "2" accordingly)
The second argument is the range to search in. Excel will look in the first column of this range for the value, and it MUST be sorted.
The third argument is the 1-based index of the column to return. In this case, you want the second column.
The final argument determines whether to return the nearest match (TRUE) or only exact matches (FALSE). You want the latter behavior.
VLOOKUP in this mode will produce an error when a match is not found (specifically #VALUE when the value would come before the first instance of the table, or #N/A if the value is not found in exact-match mode)
Copy the Column in other sheet into you want to search Duplicates,, & write this simple formula but break the database in parts to avoid system delay,,
=IF(COUNTIF($A$2:$A$8, $A2)>1, "Duplicate", "")
Use this array formula to count Duplicates,
=ROWS($A$2:$A$8)-SUM(IF( COUNTIF($A$2:$A$8,$A$2:$A$8)=1,1,0))

Resources