How to take average in excel and highlight the rows which are above average

Hello everyone,

I’m trying to take the average of all the numbers in the excel and trying to highlight the rows which are above average. I’m attaching the excel below can anyone please help me out with this.

Calculation Criteria - take the average of prices, highlight rows in excel anything above average price for all kind’s models scraped.

Note:The number of models or columns may change each time.

op.xlsx (8.6 KB)

Regards,

this is an excel question or uipath?
https://www.extendoffice.com/documents/excel/2195-excel-highlight-above-average.html

Bot has do the process using the code from UiPath studio.

can anyone help me with this !!

@varma
Use this code
yourDataTable.AsEnumerable().Sum(Function(row) row.Field(Of Integer)(“yourColumnName”)) —Sum all values in a column
Then divide the above result by yourDataTable.Rows.Count, will get average of that column.

Hey @Shivaraju,

I’m not getting it can you please elaborate it.

Use this and you should be good.

DT.AsEnumerable().Select(Function ( r) Decimal.Parse(r.Field(Of String)(“Price”).Replace(",", string.Empty).Replace("$", string.Empty))).ToList().Average

Sample:Sequence2.xaml (7.6 KB)

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