Help in "if"

condition to determine the lowest value in an “if”?

Hi @borismh,

can you provide more details?

A sample is variable1 < variable2
if variable 1 is lower then it will be true else false

@rmunro
Hello
but I have an excel with 6 different types of suppliers
-use a “for each row” to read the excel and separate each data with “get row item”
-Then use an “if” condition to know “order volume <Volume”
-in the condition that it is fulfilled place variables to save the data
-followed in the same condition “if” place “add data row” and the “excel application scope”, so that while returning to generate data saves them in a followed way
-This way I get “costototal1”, “costototal2”, etc, until 6
-Now I want to place a message in the excel next to the cells that total cost is the lowest?
that’s my doubt is there any way to do it?
thank you

@rmunro


here the condition “if”

Ok, I kinda get it.
Why not use filter datatable to filter what you want to add instead of an if?
image

To get the min value use:
just modify it.
int minVal = (int)table.Compute("Min(ColName)", "") then just use a message box to display it.
more info here: credit to the mvp.

1 Like

@rmunro
int minVal = (int)table.Compute(“Min(ColName)”, “”)
In this formula, what are the words you should use:
and I also use it as? inside a “if” true

you just need to replace table to your datatable variable and colname with your column name you want to find the min value of your datatable.