Find minimum from columns

Hello. I need to find a minimum values from 4 columns. I found this topic - Find minimum value in multiple column - but it is an example with 3 columns. I tried to edit variable for my case but it was not helpful. Here is my variable:

=If ([W]<[X]) Then (If ([W]<[Y]) Then [W] ElseIf ([Y]<[X]) Then [Y] ElseIf ([X]<[Y]) Then [X])
ElseIf([Y]<[Z]) Then [Y]
Else [Z]

And here is my table:
| W⠀| X⠀| Y⠀| Z⠀|
| 0.9 | 0.5 | 1 | 0.4 |

As you can see, minimum = 0.4. But with my variable it is 0.9.

Can anyone please tell me how to get minimum from 4 columns? And maybe from more columns. I don’t fully understand the principle of this variable. Maybe this topic will be helpful to others who will search this.

Hi Turgon,

Try this, it works perfect, hope the logic is pretty self explanatory.

=If([W]<[X] and [W]<[Y] and [W]<[Z]) Then [W]
Elseif([X]<[Y] and [X]<[Z]) Then [X]
Elseif([Y]<[Z]) Then [Y]
Else [Z]

Above formula is to find out minimum value of the 4 columns, if there were 10 columns (A to J), it would be like
=If(A<B and A<C and A<D and A<E andand A<J) Then A
and in the next line, you’d start comparing B with columns C thru J
Elseif(B<C and B<D and B<E and B<F and … B<J) Then B
and in the next line, you’d start comparing C with columns D thru J
Elseif(C<D and C<E and C<F and C<G and … and C<J) then C
Elseif compare D with E thru J
Elseif compare E with F thru J
Elseif compare F with G thru J
Elseif compare G with H thru J
Elseif compare H with I & J
Elseif compare I with J
Else J

And operator between multiple comparisons in a line is crucial for this to work. Hope this makes sense.


Hi, Mohammed.

Thank you very much! I understood the principle. And found an error (or misprint) in your formula :wink:
Second row must be not
“Elseif([X]<[Y] and [X]<[Y]) Then [X]”
“Elseif([X]<[Y] and [X]<[Z]) Then [X]”
Please edit your post If I’m right. And then I’ll mark your post as solution.


Fixed it.