How to do sumifs by using uipath

how to do sumifs for the particular data in UiPath
how to do sumifs for a column range
how to put that

Hi @anjani_priya

Could you be more specific…

If possible provide your data if it is not confidential.

sheet2.xlsx (25.8 KB)
sheet1.xlsx (16.0 KB)
sumif for this sheets to get quantity from sheet2 to sheet1
sheet2 has duplicate values . to get quantity of no’s the sumif should be done in sheet1

Hi @anjani_priya

  1. Read Range: Store in Variable DT as Datatable
  2. Assign Activity: Create Int Variable SUM and use below expression

CInt(DT.AsEnumerable.Where(Function(row) row.Field(Of String)(“A”) = “NA”).Sum(Function(row) Convert.ToDouble(row.Field(Of String)(“B”))))


Remove “A” & “B” with you DataTable Column Name or Index AND Replace “NA” with your matching String.

Hope it will helps you :slight_smile:

I have a range, how to do sum for the range
sheet2.xlsx (25.8 KB)
sheet1.xlsx (16.0 KB)
can you keep code for this data
sumif should be done for sheet1

Can you be more specific about you question:
What output you need

i want to do sumif for sheet1 and get quantity of every no from sheet2

Hi @anjani_priya,

Please find below flow as per your requirement, hope it works for you :slight_smile:
Main 1.xaml (17.8 KB)

Vinit Mhatre

what is the condition if i have to do sumifs for more columns but quantity changes
and above code taking more time
single single elements are reflecting so for 773 line items it took 700 sec

@anjani_priya (2.5 KB)

If I have more columns same as qty how to put the condition



Its Working fine.
Try by checking the sheet name you are passing correct or not.

can you specify the column name in index instead of column index

Try This (2.7 KB)

if I have other columns to do sum if at a time how to do


DT.AsEnumerable().Sum(Function(row) Convert.ToDouble(row(“Qty”)) + Convert.ToDouble(row(“OtherColumnName”)))

Happy Automation :slight_smile:

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