Vlookup among different workbook and sheets and update value - excel

I have two different workbooks. One is the master file and the other workbook is Workbook2 which has different worksheets. I need to look into the master file into column A, column E and column F. If the value from Column A and Column F is found in any of the sheets in Workbook2 then the last column in the sheets will be populated with column E from the master file. Column A and Column F from the master file is found in Column B and Column C in Workbook2. Any help is highly appreciated!!
MasterFile
A B C D E F
Yahoo 009 899 777 Spoke to client INV# 123
WorkBook2 --Expected Results Column Q
SHEET1
A B C D E F Q
ID123 Google INV# 345 89 XX 333
SHEET2 --The result was found therefore column Q is populated with Column E from
the master file.
A B C D E F Q
ID009 Yahoo INV#123 777 444 223 **Spoke to client**
SHEET3
A B C D E F Q
ID456 MICROSOFT INV#000 676 989 123

Actually you are trying to use excel as a database, which IMHO is not a good idea. Although one solution might be this. But even then it will not work, because the data in the MasterFile is incompatible with the data in SHEET2: INV# 123 is not equal to INV#123. So it will never give a result.
If you manage to get correct data, then try this:
Insert an extra column at the beginning of the MasterFile and populate it with (the original columns A and F have now shifted to B and G)
=B1&G1
Now add a VLOOKUP formula in SHEET2
=VLOOKUP(B1&C1,[Masterfile.xlsx]Sheet1!$A:$G,6,FALSE)
Another option might be put the masterfile in a database table and use a SQL query to get the data. Something like:
SELECT m.E FROM MasterFile m WHERE SHEET2.B = m.A AND SHEET2.C = m.F
There might be some errors in the SQL syntax, but I hope you get the idea.

Related

Excel Lookup and sum multiple values

A B C D D E F
DEForage201 DE Deutschland 201 Perennial Ryegrass Forage 789951
DEForage201 DE Germany 201 Perennial Ryegrass Forage 5617026
In the list above (starting in column A which is an ID line compiled by column B, F and D) I want to lookup and get the sum of the rightmost column.
Currently I am using vlookup and look for the ID line in column A, until I noticed that the country names in column C would differ during the list which is why I am having identical ID lines in column A and currently only get the first value.
Any ideas how to solve this?
Assuming you're looking for a way to view the sum of column F for each unique combination of columns A through E, a Pivot Table might be what you're looking for. You can select columns A through E as the "rows" for the pivot table, and sum of column F for the values. Adjust the report layout in the Pivot Table Design tab to get it to look the way you want.

Is there a formula that inputs on nth row of column A by reading what's in column F and/or D on their congruent rows?

I'm very new to excel programming. Currently I'm working on an excel worksheet and I need a formula that inputs on nth row of column A by reading what's in column F and/or D on their congruent rows. So far I have something like:
=IF(AND(D:ROW(n)=0,F:ROW(n)="x"),A:ROW(n)="e",IF(D:ROW(n)=0,"N","X"))
e.g.
A B C D E F
1 e 0 x
2 N 0
3 X 2
Put this in A1:
=IF(D1 = 0,IF(F1="x","e","N"),"X")
And copy down.
The references are Relative, so as the formula is copy/dragged down they will change on their own.

Sorting columns with gaps in Excel / Google Sheets

I'd like to sort several columns in google sheets, but with gaps where there are no matching values in other columns present.
See my example:
Start:
c a z
a k d
d x f
e b m
x e b
Sorted:
a a
b b
c
d d
e e
f
k
m
x x
z
So, is this possible in google sheets and/or Excel? I would prefer google spreadsheets if possible.
For Google Sheets try the formula:
=ArrayFormula(IFERROR(VLOOKUP("r"&ROW(INDIRECT("A1:A"&COUNTUNIQUE(INDIRECT(myRange))))&"c"&TRANSPOSE(ROW(INDIRECT("A1:A"&COLUMNS(INDIRECT(myRange))))),{"r"&VLOOKUP(SORT(TRANSPOSE(SPLIT(CONCATENATE("_"&"_"&INDIRECT(myRange)),"_"))),{UNIQUE(SORT(TRANSPOSE(SPLIT(CONCATENATE("_"&"_"&INDIRECT(myRange)),"_")))),ROW(INDIRECT("A1:A"&COUNTUNIQUE(INDIRECT(myRange))))},2,0)&ARRAY_CONSTRAIN(SORT({TRANSPOSE(SPLIT(CONCATENATE("_c"&COLUMN(INDIRECT(myRange))*ROW(INDIRECT(myRange))^0),"_")),TRANSPOSE(SPLIT(CONCATENATE("_"&"_"&INDIRECT(myRange)),"_"))},2,1,1,1),ROWS(INDIRECT(myRange))*COLUMNS(INDIRECT(myRange)),1),SORT(TRANSPOSE(SPLIT(CONCATENATE("_"&"_"&INDIRECT(myRange)),"_")))},2,0)))
To make it work first make named range called myRange and paste there an address of desired range:
Please see my sample file with the solution.

Compare columns in two sheets

I have two sheets in Excel that I am trying to compare. This is a bit convoluted so I hope my explanation is clear.
Sheet 1 is named 'mapping and Sheet 2 is named SOA
I would like to compare column D in 'mapping' to column A in 'SOA'
Where the value in column D of mapping is equal to the result in column A of 'SOA' I would like to enter the corresponding text info from column B of SOA into column E (which is blank) in 'mapping'
Column A in SOA is in ascending order while column D is not, and cannot be.
A sample for the data is:
Sheet 1 (Mapping)
A B C D E
A1.3
A1.1
A1.2
Sheet 2 (SOA)
A B C D E
A1.1 YES
A1.2 MAYBE
A1.3 NO
A1.4 IDK
The result I am looking for would give me:
Sheet 1 (Mapping)
A B C D E
A1.3 NO
A1.1 YES
A1.2 MAYBE
I have tried the following formulas but have not gotten any luck
=IF(COUNTIFS(('mapping'!D3:D466),=SOA!A4:A136",SOA!B4,""))
=IF('mapping'!$D3:$D466=SOA!$A4:$A136,SOA!$B4:$B136,"")
Thanks everyone, I got it working with a combo of all of this. Some of the issue was the nature of the data I receive

Performing a find within a find EXCEL VBA

Please help me,
Take for example I have the following set of data:
Column A (Sheet1) | Column B (Sheet1) | Col. A (Sheet4) | Col B (Sheet4) | Col C(Sheet4)
----------1A2B----|---------1111------|-------1111------|--------AAAA----|------ABAB----|
----------2B1A----|---------2222------|-------2222------|--------BBBB----|------AABB----|
----------1B1B----|---------3333------|-------3333------|--------CCCC----|------AABB----|
I already have developed a function code that will find the corresponding value of Column B in sheet 1 to the column A in sheet 4. For example my code will automatically return the values AAAA & ABAB if for all 1111 values in Col B on Sheet 1.
The problem is that if the value in Col C Sheet 4 equals to AABB, i have to perform another search within another table (for example the table is located at sheet 5). And this time the basis of my seach will be the Col A on sheet 1 because Col A has its own mapping. So i have to perform another search. Can someone please help me with this. I am a newbie when it comes to excel vba. Oh and by the way it has to be on excel vba.
So for example if my code sees the value 2222 on sheet 1 Col B. It will be like this:
Column A (Sheet1) | Column B (Sheet1) | Col. A (Sheet4) | Col B (Sheet4) | Col C(Sheet4)
--------------1A2B----|---------2222----------|-------2222--------|--------BBBB-----|------AABB----|
The code will see the AABB and it will perform another search using the 1A2B code. The 1A2B is mapped to another table.
Please help me.
Sounds like you should use the VLOOKUP worksheet function at both levels. You can use the function in VBA with the following:
Application.WorksheetFunction.VLOOKUP(value to lookup, range to look in, column # to return data from, FALSE)

Resources