DIFFICULT -

G

Guest

Guest
In one file I have multiple rows and columns of data.

In the second file I am trying to write a CSE(Array Formula) which will print values into column A of file2. It should:
Look at all the values in file1!B2:B200
If the value in the file1!B column is "high" then it should print the exact text of the corresponding file1!E column into the next available slot in the A column of file2.

Example:

in file1
b1="low" ----e1="apples"
b2="high" ----e2="oranges"
b3="low" ----e3="pears"
b4="high" ----e4="grapes"
. . .


then I would like a formula that inputs in file2 column A and returns
oranges in A1
grapes in A2
. . .

Thanks.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
This is a bit crude, but I think it gets you where you need to be. I can't think of a formula to do what you want as it would need to keep pointing at different cells, but try adding this to your File2 and running it.


Sub Macro1()
'
' Macro1 Macro
' Macro recorded 27/02/02 by GaryB
'


Dim myrow As Integer
Dim myrow2 As Integer
Dim RowEtext As String


myrow = 1
myrow2 = 0

For myrow = 1 To 200

Windows("file1.xls").Activate
Range("A1").Select
If ActiveCell.Offset(myrow - 1, 1) = "high" Then
RowEtext = ActiveCell.Offset(myrow - 1, 4)
Windows("file2.xls").Activate
Range("A1").Select
ActiveCell.Offset(myrow2, 0) = RowEtext
myrow2 = myrow2 + 1
End If
Next myrow

'
End Sub


HTH

GaryB
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,435
Members
448,898
Latest member
dukenia71

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top