Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Recreate Excel formula to locate smallest number in a table

ReluctantProgrammer
Level 2
Level 2

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
Kosta_Prokopiu1
Correct answer by
Employee
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
Kosta_Prokopiu1
Correct answer by
Employee
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

Mayank_Gandhi
Community Advisor
Community 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