I have a Winform that i import an Excel sheet to a datagrid. I am needing to do a comparison of 2 columns and a static value.
Example
If column (F) is greater than static value Z4=(48) then return 48 in column (V1) if less than return column value(G) to column (V1).
The code below will do the greater than part, how would i add the part if its less than?
decimal F = Convert.ToDecimal(dataGridView1.Rows[i].Cells[5].Value ?? 0);
var Z4 = 48;
Math.Max(F, Z4);
var V1 = Math.Max(F, Z4);
dataGridView1.Rows[i].Cells[8].Value = V1;// I need to add this
decimal G = Convert.ToDecimal(dataGridView1.Rows[i].Cells[6].Value ?? 0);
Booney440