#26 — Get Two Numbers from Each of The Two Sets of Numbers and Let Them Equal A Specified Value

Problem description & analysis:

We have two rows of numbers:

Get two numbers from each row (the two numbers can be the same) and make the sum of the four numbers the fixed value 26216692; put the two numbers obtained from row 1 in column A and c…


This content originally appeared on DEV Community and was authored by Judith-Excel-Sharing

Problem description & analysis:

We have two rows of numbers:

original table
Get two numbers from each row (the two numbers can be the same) and make the sum of the four numbers the fixed value 26216692; put the two numbers obtained from row 1 in column A and column B, and the ones obtained from row 2 in column C and column D, as shown below:

desired table

Solution:

Use SPL XLL to get this done:

=spl("=g1=E@1(?1),g2=E@1(?2),E@b(xjoin(g1;g1;g2;g2).select(#1+#2+#3+#4==26216692 && #1>=#2 && #3>=#4))",A1:G1,A2:F2)

As shown in the picture below:

result table with code entered

Explanation:

xjoin function performs cross product. E@1 converts a multilayer sequence to a single-layer one. E@b removes titles, and #1 represents the 1st column of the table.


This content originally appeared on DEV Community and was authored by Judith-Excel-Sharing


Print Share Comment Cite Upload Translate Updates
APA

Judith-Excel-Sharing | Sciencx (2024-07-16T07:18:07+00:00) #26 — Get Two Numbers from Each of The Two Sets of Numbers and Let Them Equal A Specified Value. Retrieved from https://www.scien.cx/2024/07/16/26-get-two-numbers-from-each-of-the-two-sets-of-numbers-and-let-them-equal-a-specified-value/

MLA
" » #26 — Get Two Numbers from Each of The Two Sets of Numbers and Let Them Equal A Specified Value." Judith-Excel-Sharing | Sciencx - Tuesday July 16, 2024, https://www.scien.cx/2024/07/16/26-get-two-numbers-from-each-of-the-two-sets-of-numbers-and-let-them-equal-a-specified-value/
HARVARD
Judith-Excel-Sharing | Sciencx Tuesday July 16, 2024 » #26 — Get Two Numbers from Each of The Two Sets of Numbers and Let Them Equal A Specified Value., viewed ,<https://www.scien.cx/2024/07/16/26-get-two-numbers-from-each-of-the-two-sets-of-numbers-and-let-them-equal-a-specified-value/>
VANCOUVER
Judith-Excel-Sharing | Sciencx - » #26 — Get Two Numbers from Each of The Two Sets of Numbers and Let Them Equal A Specified Value. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/16/26-get-two-numbers-from-each-of-the-two-sets-of-numbers-and-let-them-equal-a-specified-value/
CHICAGO
" » #26 — Get Two Numbers from Each of The Two Sets of Numbers and Let Them Equal A Specified Value." Judith-Excel-Sharing | Sciencx - Accessed . https://www.scien.cx/2024/07/16/26-get-two-numbers-from-each-of-the-two-sets-of-numbers-and-let-them-equal-a-specified-value/
IEEE
" » #26 — Get Two Numbers from Each of The Two Sets of Numbers and Let Them Equal A Specified Value." Judith-Excel-Sharing | Sciencx [Online]. Available: https://www.scien.cx/2024/07/16/26-get-two-numbers-from-each-of-the-two-sets-of-numbers-and-let-them-equal-a-specified-value/. [Accessed: ]
rf:citation
» #26 — Get Two Numbers from Each of The Two Sets of Numbers and Let Them Equal A Specified Value | Judith-Excel-Sharing | Sciencx | https://www.scien.cx/2024/07/16/26-get-two-numbers-from-each-of-the-two-sets-of-numbers-and-let-them-equal-a-specified-value/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.