apply sum with excel
hi everyone, i try to make a sum of column, but when i try to use the activity, a error appear and say “the column name is invalid”.

i see the topic [how to sum all values in a column of an excel/datatable?](https://forum.uipath.com/t/how-to-sum-all-values-in-a-column-of-an-excel-datatable/15268) but dont know how the others do.

anyone can give me a example?

[capture] [[capture2]](https://aws1.discourse-cdn.com/uipath/original/3x/c/7/c7bca61b0af613362ed48fbda0c144cee8488053.png "capture2.png") [[sump…](https://aws1.discourse-cdn.com/uipath/original/3x/7/2/724ff787add8b8ece36f4d2e9f56a3694cc17670.png "sumproblem.png")
hi [@rpatest\_pwc](/u/rpatest_pwc)

have you checked if your column in excel has any spaces before or after the actual word suma?
Did you bind the listBox1, using DataSource property from DataTable?  

If so, you have to 1st get the item and value from listBox item and add it some other place (in your case to listBox2):



```
for(int i = 0; i < listBox1.SelectedItems.Count; i++)
{
     DataRowView view = listBox1.SelectedItem as DataRowView;
     string item = view["ColumnNameOfItem"].ToString(); //can be some name
     int value = Convert.ToInt32(view["ColumnNameOfValue"]);  //can be some id (number)
     listBox2.Items.Add(item); // it you want to add item (you can add value as well);
}
```

ColumnNameOfItem (or OfValue) are the names of fields in your dataTable (and same are in dataBase as well). Insteads of names you can use indexes (0 and 1, but without quotation marks).



Hope it helps.  

bye welcome to mrexcel!

it actually works for me (see below). this appears to be a kind of rounding error. the way excel stores numbers causes some issues when you have decimals. it is a bit rare when comparing a cell to itself, but it can happen. you can try to use sumproduct instead, see column h.

efgh1valuescountifranksumproduct248737.76222336113.11333454287.76111f2:f4f2=countif($e$2:$e$4,">"&e2)+1g2:g4g2=rank.eq(e2,$e$2:$e$4)h2:h4h2=sumproduct(--(round($e$2:$e$4,2)>round(e2,2)))+1 Should be able to do something like this:


UPDATE table\_name  

SET new\_column = (calculated value)  

WHERE new\_column is NULL Turns out If I tweked each method 



```
foreach (var dataColumn in readFields.Select(column => new DataColumn(columntypeof(string)) { AllowDBNull = true, DefaultValue = string.Empty }))
{
    csvData.Columns.Add(dataColumn);
}

```

and in the second Method I changed it to use an index rather than column name



```
for (var count = 0; count < table.Columns.Count; count++)
{
    sqlBulkCopy.ColumnMappings.Add(count, count);
}

``` thanks i was able to use something similar. i have just seen online that we’re not able to extract column values for calculated columns? is there any other way of extracting this data?

query = """ query { boards (ids: %s limit: 20, page: 1) { id name columns … i would do it like this:

https://www.advanced-excel.com/columns-to-rows.html hatayı buldum. tablomdan 2 alan çekip value değerine yazdırmaya çalıştığım için sanırım bu hata oluştu. value: value değerini value: value.kat\_ad olarak duzeltince sorun düzeldi you’re on the right track.

is the name column of the choices table of the same column type as the 1st place and 2nd place columns?

please post a screenshot of the error message and the complete expression to which it refers. Your function works, but both the IF and the ELSE return an alert message that says its invalid.  

The first part - the IF - should return in the alert box "Valid SSN"  

I am assuming your input should be like this 123-45-1234


but do you need to tell the user the input is valid? Surely the alert should only be displayed if the input is invalid? So the if should return nothing. imho Check if any of the values in the cells are null.  

If they are you need to modify your code to check for null conditions before using `ToString()`.