How to find combination of multiple cells in a range in excel - excel

How can I find all of multiple cell values of an excel workbook in a column of other workbook?
Example:I have 2 workbooks workbook 1 and workbook 2
in Workbook 1 I need a formula in D1 which finds all the words of the first row in workbook 2 range A:A and returns the value of second column of workbook 2.
For instance, In D1 the formula needs to return 1423.00, though there is an extra word in A1 - "boy".

try this per the sample image,
=INDEX(G:G, AGGREGATE(15, 7, ROW(A:A)/(ISNUMBER(SEARCH(A2, F$1:F$5))*ISNUMBER(SEARCH(B2, F$1:F$5))*ISNUMBER(SEARCH(C2, F$1:F$5))), 1))

As per your sample given
workbook 1 name is Book17 and workbook 2 name is Book19 in below formula. Apply the below formula in Book17 in D2
=TEXT(IF(ISERROR(FIND(A2&" "&B2&" "&C2,[Book19]Sheet1!A2)),"Not Match",INDEX([Book19]Sheet1!A2:B2,1,2)),".00")

As per your sample given
workbook 1 name is Book17 and workbook 2 name is Book19 in below formula. Apply the below formula in Book17 in D2
=TEXT(IF(ISERROR(FIND(A2&" "&B2&" "&C2,[Book19]Sheet1!A2)),"Not Match",INDEX([Book19]Sheet1!A2:B2,1,2)),".00")
workbook 1:
Workbook 2:

Related

Excel VBA get dynamic values from a source sheet to destination sheet

I am new to VBA and I have been trying this for a while but so far no luck.
I have a workbook with 2 dynamic sheets 1 and 2. Each sheet has Column A(Tag ID),B(ID variation),C(values). I want to copy column C from sheet2 into column D of sheet1 if values of Column A&B in sheet1 match A&B of sheet2. There is also a chance that sheet 2 might not have all the entries for samples and only a portion of sample names will be available.
Any help is appreciated.
If Column C is just numeric data, then you could accomplish what you're trying to do without VBA and just use SumIfs or SumProduct.
Insert the below formula in your sheet1 cell D1 and drag down.
=SUMIFS(Sheet2!C:C,Sheet2!A:A,A1,Sheet2!B:B,B1)
Also, if you have Excel spill range feature, you could use a dynamic formula that would self-populate as rows are added.
=FILTER(SUMIFS(Sheet2!C:C,Sheet2!A:A,A1:A999999,Sheet2!B:B,B1:B999999),NOT(ISBLANK(A1:A999999)))
It sounds like you could create references to sheet 1 and 2, and loop through one of the sheets, while checking existence of each entry in the other sheet, and copying the value over if A&B match.
It's been a while since I've written VBA and this is not a great solution performance-wise, but this might help you get started.
Rough Example (definitely not syntactically correct, and is missing assigning sheet1 and sheet2 to the actual workbooks):
Dim sheet1 As Worksheet
Dim sheet2 As Worksheet
For row In sheet1
For row2 In sheet2
If row.Range("A").Value == row2.Range("A").Value
If row.Range("B").Value == row2.Range("B").Value
row.Range("D").Value = row2.Range("C").Value

copy row values from one sheet to another sheet for the matched records in Excel

I have two sheets in an excel workbook and Sheet1 has the following columns:
and Sheet 2 has only ID column:
If ID in sheet 2 matches with ID in sheet 1 I want to write col1 and col2 values in sheet1 to sheet 2
I used VLOOK up to identify the matched records but I am manually copying the values of the matched records into sheet 2 and I have to do this for 100,000 rows. I really appreciate if I can get some help.
In your sheet 2, in cel B2 write this formula: =IFERROR(INDEX(Sheet1!$A$1:$C$4,MATCH(Sheet2!A2,Sheet1!A:A,0),2),"")
In your sheet 2, in cel C2 write this formula: =IFERROR(INDEX(Sheet1!$A$1:$C$4,MATCH(Sheet2!A2,Sheet1!A:A,0),3),"")
Change matrix offcourse to your needs and drag down!

Excel creating additional sheets by copying but keeping formula

I have a workbook (we are using them for electronic purchase orders) and I need to be able to copy a worksheet but have the formula in it increment like it would if I copied the formula in a sheet.
In other words in sheet2 I1 the formula is ='Sheet1'!$I$1+1. When I copy sheet2 and it becomes sheet3, I need the formula in I1 to say ='Sheet2'!$I$1+1.
How can i do this?
You can get a string containing the current sheet name with the following formula
=cell("filename",A1)
If you are using the standard Sheet# for your pages, then you can get the current sheet number with this formula (assuming the previous one was in B3)
=RIGHT(B3,LEN(B3) - FIND("]Sheet",B3,1)-5)
Next calculate the number for the previous sheet
=VALUE(B4)+1
Now you can use the indirect function to address a cell in the previous sheet
=INDIRECT("Sheet"&B5&"!B1")
In Sheet4, this will reference B1 in Sheet3.
Copy it to Sheet5 and it will reference B1 in Sheet 4.

Excel VBA matching record copy data between worksheets

I have spent the last week trying to find a solution to this. I'm a total novice in VBA and I need to match a name in column B of worksheet 1 with column A of worksheet 2 and then copy column C of worksheet 1 to the matched row in worksheet 2.
You can do this without VBA.
In worksheet 2 column C use the following formula
=VLOOKUP(A:A,Sheet1!B:C,2,false)
Replace Sheet1 with your sheet name.

How to copy data from one worksheet to another

I want to copy some data from one cell in worksheet 1 to another cell in worksheet 2 if it meets some condition.
So I am using:
=IF(Sheet3!C49=0,"",Sheet3!C49)
where If cell C49 in sheet 3 has something in it then copy whatever is in cell C49 in sheet 3 into the cell that contains this formula.
This works perfectly for text but when I enter a date of 31/07/2009 in cell C49 then the cell with the above formula says 40025 (all dates give odd numbers). The whole of column C has dates in it.
When I enter an integer in cell C49 in sheet 3 (eg. 12), then cell C49 in sheet 3 says "12/01/1900" but the cell in the other worksheet which contains the above formula says 12.
What I want to do is copy the date from cell C49, sheet 3, into the cell with the above formula.
Can anyone help?
Have you tried formatting the column containing the funny number as Date? The funny number is Excel's serial representation of the date.
Alternatively if you just want the date as text you could use the function =TEXT(A1,"yyyyMMdd") etc...
If you wish to copy both the values and the formatting then you'll probably want to knock up a VBA macro.

Resources