B
B
bivin2014-06-02 21:40:47
PHP
bivin, 2014-06-02 21:40:47

How to make a selection by value in Excel

How to make a form.? Suppose there are 20-30 digital values ​​from this range, 16
maximum values ​​\u200b\u200bare added together and the resulting amount is multiplied by a certain
coefficient
15 30 25 22 20 8 6 4 7 5 6 7 12 25 56 40 98 15 30 25 22 20 8 6 4 7
from these numbers the maximum value (16) is selected and added together
You can use not Excel but php to make one enter the values ​​in the window and in the other window you will get the result.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya Lesnykh, 2014-06-03
@bivin

You can use php instead of excel

then like this:
0) we have an array of numbers
1) sort the array in descending order
2) cut the array to length 16
3) apply the array_product function
$originalString = '5 6 7 12 25 56 40 98 15 30 25 22 20 8 6 4 7 5 6 7 12 25 56 40 98 15 30 25 22 20 8 6 4 7 5 6 7 12 25 56 40 98 15 30 25 22 20 8 6 4 7';
$originalArray = implode(' ', $originalString);
rsort($originalArray);
$originalArray = array_slice($originalArray, 0, 16);
echo 'Итого: ', array_product($originalArray);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question