How to get the index of the column where value says "Y"

How to get the index of the column where value says “Y”

Use Case Description

I am facing difficulty in getting the index values in the excel where the value says “y” .Fo a single “y” I did use Lookup range and got the index value due to which I could extract the currency value corresponding to it.But in case of multiple “y” I am facing difficulty in get the values where it says “y”.Can anyone help me with this ?


Other information about the use case

Industry categories for this use case: Other Sector

Skill level required: Advanced

UiPath Products that were used: UiPath Studio

Other applications that were used: -

Other resources: -

What is the top ROI driver for this use case?: Other


Can you try the following steps?

First ReadRange without AddHeaders option(Let’s say dt)


 arrResult = dt.Columns.Cast(Of DataColumn).Where(Function(c) dt.Rows(0)(c).ToString="y").Select(Function(c) c.Ordinal).ToArray()


When all row Indexes are needed, where a partivlar col value equals y:

Lets assume the Excel ist read in into a datatable

Assign activty

arIndex datatype: int32( ) =

Enumerable.range(0,dtData.rows.count).Where(function (x) dtData.rows(x)(colnameorindex).toString().trim().equals("y")).toarray

I did try this…Got the array indexes …But not quite sure how to retrieve the corresponding currencies.Can you help me with that?

I got the answer-The values corresponding to the cells.
Thank you so much. It helps slight_smile:

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