Expand my Community achievements bar.

SOLVED

Recreate Excel formula to locate smallest number in a table

Avatar

Level 5

Looking for code to re-create this Excel formula which identifies the lowest number in a table column and places it in a different field.  

 

="Single Unit:" &CHAR(10)& IF(COUNT(AB17:AB23)>0,TEXT(ROUNDDOWN(MIN(AB17:AB23),0),"0") & " tons",IF(COUNT(AB24:AB27)>0,TEXT(ROUNDDOWN(MAX(Z17:Z23),0),"0") & " tons",IF(AND(ISNUMBER(G28),ISNUMBER(G29),ISNUMBER(G30),ISNUMBER(G31),MIN(G28:G31)<1),"LL","n/a")))

1 Accepted Solution

Avatar

Correct answer by
Employee

If you make your table in a fitting way then it should be very easy:

Kosta_Prokopiu1_0-1625149213071.png

Check https://help.adobe.com/en_US/livecycle/10.0/DesignerFormCalcRef/WS92d06802c76abadb-32254d55129f5ee7c... for the min() function of FormCalc

And here the result:

Kosta_Prokopiu1_1-1625149274695.png

 

View solution in original post

3 Replies

Avatar

Correct answer by
Employee

If you make your table in a fitting way then it should be very easy:

Kosta_Prokopiu1_0-1625149213071.png

Check https://help.adobe.com/en_US/livecycle/10.0/DesignerFormCalcRef/WS92d06802c76abadb-32254d55129f5ee7c... for the min() function of FormCalc

And here the result:

Kosta_Prokopiu1_1-1625149274695.png

 

Avatar

Employee Advisor

@ReluctantProgrammer You can use the javascript function to find a min or max amongst the array of objects. Rather than converting excel formula try to load the same computation via a javascript function. 

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max