# How to find the minimum value of array elements?

**URL:** <https://forums.unrealengine.com/t/how-to-find-the-minimum-value-of-array-elements/482877>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [May 4, 2021, 12:46pm UTC](https://forums.unrealengine.com/t/how-to-find-the-minimum-value-of-array-elements/482877 "2021-05-04T12:46:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shedels](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shedels/32/1121823_2.png) [@Shedels](https://forums.unrealengine.com/u/Shedels)\
**Post date:** [May 4, 2021, 12:46pm UTC](https://forums.unrealengine.com/t/how-to-find-the-minimum-value-of-array-elements/482877/1 "2021-05-04T12:46:01Z")

</div>

Hello!

I have float array with 3 elements. I need to find the minimum value of array elements. Can you show me an example?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 4, 2021, 4:04pm UTC](https://forums.unrealengine.com/t/how-to-find-the-minimum-value-of-array-elements/482877/3 "2021-05-04T16:04:09Z")

</div>

This^

There are also these when you do not want / need to faff around with arrays:

![337942-screenshot-3.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/7/e/77e31f0b85fa126a771dcc30abc5b3410796c718.png)

And these can be useful when you deal with vectors:

![337943-screenshot-4.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/d/8/3d8b5f43728957075bd1f681a7d63de80dd80dce.png)

---

<div class="post-metadata">

**Author:** ![usa423](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/usa423/32/918773_2.png) [@usa423](https://forums.unrealengine.com/u/usa423)\
**Post date:** [January 4, 2025, 3:03am UTC](https://forums.unrealengine.com/t/how-to-find-the-minimum-value-of-array-elements/482877/4 "2025-01-04T03:03:54Z")

</div>

> [@Everynone](#):
>
> This^
> 
> There are also these when you do not want / need to faff around with arrays:

How to know out of that single output which one was lowest?

---

<div class="post-metadata">

**Author:** ![ArghCrazy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ArghCrazy](https://forums.unrealengine.com/u/ArghCrazy)\
**Post date:** [January 4, 2025, 3:25am UTC](https://forums.unrealengine.com/t/how-to-find-the-minimum-value-of-array-elements/482877/5 "2025-01-04T03:25:41Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/b/8/db8d5d1c2100892aaa5dc30ace445b1219c4a431.png)

from my understanding. these are basically just macros that run a loop that compares each value individually. So if you need them for a different data type, just create your own macro library.

---

<div class="post-metadata">

**Author:** ![usa423](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/usa423/32/918773_2.png) [@usa423](https://forums.unrealengine.com/u/usa423)\
**Post date:** [January 4, 2025, 7:13pm UTC](https://forums.unrealengine.com/t/how-to-find-the-minimum-value-of-array-elements/482877/6 "2025-01-04T19:13:02Z")

</div>

Thanks

---

<div class="post-metadata">

**Author:** ![usa423](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/usa423/32/918773_2.png) [@usa423](https://forums.unrealengine.com/u/usa423)\
**Post date:** [January 4, 2025, 7:14pm UTC](https://forums.unrealengine.com/t/how-to-find-the-minimum-value-of-array-elements/482877/7 "2025-01-04T19:14:44Z")

</div>

> [@usa423](#):
>
> How to know out of that single output which one was lowest?

Here is how I was able to do it. Every float input that MIN node receives have it be a variable, and right after create a set of branches that check for = = and check those floats and you can determine exactly what float was the lowest.

---

<div class="post-metadata">

**Author:** ![usa423](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/usa423/32/918773_2.png) [@usa423](https://forums.unrealengine.com/u/usa423)\
**Post date:** [January 4, 2025, 9:25pm UTC](https://forums.unrealengine.com/t/how-to-find-the-minimum-value-of-array-elements/482877/8 "2025-01-04T21:25:49Z")

</div>

The problem I am seeing with that min node is if an actor is no longer valid it doesn’t change on the inputs.

Wonder how to stack those results from greatest to least after the MIN node?

---

<div class="post-metadata">

**Author:** ![ArghCrazy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ArghCrazy](https://forums.unrealengine.com/u/ArghCrazy)\
**Post date:** [January 5, 2025, 3:17am UTC](https://forums.unrealengine.com/t/how-to-find-the-minimum-value-of-array-elements/482877/9 "2025-01-05T03:17:10Z")

</div>

stack results? you mean basically reorder the array with the greatest value at index 0 and so on?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/2/e/f2e1705c4381f89e187087771a6ec88d3a2252bd.jpeg)  
NVM they added a node for this  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/8/6/e867fb8f2c28dd4e78423551131c41d68c799f69.png)  
this must be new as this is the first time i’ve noticed it. but also. I feel like you need to learn how to navigate your node selection menu  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/6/2/462e5eab85dd3919b6fdfbd2bf0243f8ff2cfff5.png)  
all of your array nodes are sorted here. and if your context sensitive is checked and your dragging off a Float Array it will only show the nodes that are valid for float arrays.  
another useful spot is MATH  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/e/9/3/e933b2acb0dbae1382f37b75130b233af1facc7e.png)

---

<div class="post-metadata">

**Author:** ![usa423](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/usa423/32/918773_2.png) [@usa423](https://forums.unrealengine.com/u/usa423)\
**Post date:** [January 5, 2025, 10:37pm UTC](https://forums.unrealengine.com/t/how-to-find-the-minimum-value-of-array-elements/482877/10 "2025-01-05T22:37:15Z")

</div>

> [@ArghCrazy](#):
>
> stack results? you mean basically reorder the array with the greatest value at index 0 and so on?

Yes, exactly.

Thanks for the info.
