How to get mutiple values between two different excel files? (which is conforming to the condition)

Hello.

I’m learning about automation in excel.
I have problem with my case.

First, I want to find name “zoe” in file named “2.xlsx”

Second, I want to get value from ‘C2’ and ‘C4’ in file named “2.xlsx”

Third, In file named “1.xlsx”, I want to input value ‘C2’+‘C4’ in ‘B2’ cell.

Could you tell me how to do this?

I would like to know ,
How can I get multiple value which is conforming to the condition in two different excel files.

1 Like

FIne @111104

Welcome to UiPath community buddy

kindly follow the below steps

  1. use excel application scope and pass the the file path as input
  2. use read range application scope this the above activity and get the output as a variable of type datatable and name it outdt
  3. use a for each row loop activity and pass the above variable outdt as input to this activity
  4. mean while create a variable in variable panel of type list(of int32) named in_list_integer with default value of new list (of integer)
    inside the for each row loop to get the value of zoe…use a if condition activity like this with condition
    row(“name”).ToString.Equals(“zoe”)
    and if the above condition gets passed it will go to THEN part and there we can get the value of zoe using a add to collection activity where mention these input in the properties of add to collection
    – collection = in_list_integer
    – item = Convert.ToInt32(row(“donation”).ToString)
    – type argument as int32
    so now this collection will have the value of zoe to be summed up
  5. Then to place the sum of zoe in B2 being still in the for each row loop, next to this add to collection use a for each loop and mention the input as in_list_integer and change the type argument as int32
  6. inside the for each loop, use a assign activity and mention like this
    and create a outfinalvalue a variable of type int32 with default value as 0
    outfinalvalue = outfinalvalue + item
  7. after the loop you can place the value of outfinalalue in the B2 cell using write cell activity as we still inside the excel application and for each row loop activity…
    where mention the value as outfinalvalue.ToString and range as B2 and mention the sheetname…you have in your excel
    Cheers @111104

Hi @111104

I have created workflow based on your requirement here I create two excel files(1.xlsx,2.xlsx)
please open run and check you will get the solution.

Excel.zip (22.9 KB)