Recreate Excel formula to locate smallest number in a table

Avatar

Avatar
Validate 1
Level 1
ReluctantProgrammer
Level 1

Likes

0 likes

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
ReluctantProgrammer
Level 1

Likes

0 likes

Total Posts

5 posts

Correct reply

0 solutions
Top badges earned
Validate 1
View profile
ReluctantProgrammer
Level 1

01-07-2021

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")))

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Affirm 100
Employee
Kosta_Prokopiu1
Employee

Likes

165 likes

Total Posts

371 posts

Correct reply

107 solutions
Top badges earned
Affirm 100
Validate 1
Establish
Give Back 5
Give Back 3
View profile

Avatar
Affirm 100
Employee
Kosta_Prokopiu1
Employee

Likes

165 likes

Total Posts

371 posts

Correct reply

107 solutions
Top badges earned
Affirm 100
Validate 1
Establish
Give Back 5
Give Back 3
View profile
Kosta_Prokopiu1
Employee

01-07-2021

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

 

Answers (1)

Answers (1)

Avatar

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile

Avatar
Springboard
Level 10
Mayank_Gandhi
Level 10

Likes

327 likes

Total Posts

1,150 posts

Correct reply

185 solutions
Top badges earned
Springboard
Establish
Validate 1
Contributor 2
Ignite 5
View profile
Mayank_Gandhi
Level 10

05-07-2021

@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