StudioX For Each Row in Excel using VLookup

I’ve created a vlookup that simply looks at one excel (range C:C) and sees if match into another excel (range A:C) file.It works for the one row that I found a match on using the vlookup. However, when I try to put in inside an “Excel for Each Row” task, it doesn’t return a single cell but it does act like it is going through the motions(For each current row in range (C:C) with headers. It is a pretty simple vlookup (range is AA:CC), and a single cell to return (D:D) off another file. I’ll try to post a screenshot, if I can figure out how.

Hi there, I’m having the same issue. V-lookup is saved to the first row, but I would need to have outcomes on multiple rows along the range, all the way down, not just the first row.
Can anyone tell me how to do it all the way down?

Best regards,
Julio

Hi Lori, Julio :slightly_smiling_face:
In order for the VLookup activity will run on each line of your xlsx sheet, you will need to use the ‘CurrentRow’ within the VLookup input fields, as followed:

1 Like

Hi - after reading these directions to do VLOOKUP’s, it looks like you’ve named a range of cells “id” and “result” - is this necessary? If so, how do I do that in order for VLOOKUP function to run. I have 2 x 1000 row excel files that I’m trying to match up with VLOOKUP and it seems like this process is only allowing me to put the “result” in 1 cell only - what about the other 999 cells that may or may not match up?

Hi Margaret,

The “Id” and “Result” are the headers of the range specify within the ForEach loop: Sheet1!A1:B127

When I selected the range via Excel it automatically copied those headers.
As you can see, the CurrentRow index iterate every row in that range.

The VLookUp activity uses that CurrentRow to iterate a different range: Sheet2!A2:B127,
so it will fetch the value of column 2 (in that range) and paste it to the CurrentRow at the “Result” column specified in the For Each range.

1 Like

Thank you so much it worked for me , i was struggling where to find the solution

1 Like

Hi Majil!
Please mark this as a solution :slight_smile:

Thank you for the solution. I appreciate it.

1 Like

Thanks team, after reading your discussion, I got the solution. :+1:

Too much to learn.

Since you created this question, only you can mark the comment above as a solution. Please do so in your free time :slightly_smiling_face:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.