Formula to find out the largest odd number and even number in a array?

asdeq2006

New Member
Joined
Oct 27, 2017
Messages
3
There are some rules:
1. Any variable/input can only be used one time. For example, if cell "A1" is input, then cell "A1" in the formula can only appear one time. (The formula like this "=if(A1=???,A1,0)" is not allowed)
2. Can't use other cells to do calculation.
3. No Name and No VBA are allowed.

Question:
Now, there are 6 numbers which have at least two odd numbers and two even numbers. Please find out the answer in a, b, c question respectively.

a ) Largest {odd,even}
b ) Smallest {odd,even}
c ) {odd(smallest),odd(largest),even(smallest),even(largest)}

Example:
Part a) Largest {odd,even}
{123,409,323,228,332,108}
{1,2,3,4,5,6}
{500,1,4,301,305,303}
{409,332}
{5,6}
{305,500}

<colgroup><col style="width: 243px"><col width="357"></colgroup><tbody>
[TD="bgcolor: #6d9eeb"]Example input
[/TD]
[TD="bgcolor: #6d9eeb"]Example output
[/TD]

</tbody>


Part b) Smallest {odd,even}
{123,409,323,228,332,108}
{1,2,3,4,5,6}
{500,1,4,301,305,303}
{123,108}
{1,2}
{1,4}

<colgroup><col style="width: 243px"><col width="357"></colgroup><tbody>
[TD="bgcolor: #6d9eeb"]Example input
[/TD]
[TD="bgcolor: #6d9eeb"]Example output
[/TD]

</tbody>


Part c) {odd(smallest),odd(largest),even(smallest),even(largest)}
{123,409,323,228,332,108}
{1,2,3,4,5,6}
{500,1,4,301,305,303}
{123,409,108,332}
{1,5,2,6}
{1,305,4,500}

<colgroup><col style="width: 243px"><col width="357"></colgroup><tbody>
[TD="bgcolor: #6d9eeb"]Example input
[/TD]
[TD="bgcolor: #6d9eeb"]Example output
[/TD]

</tbody>

 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Whilst it may well be possible, I didn't read the op thoroughly & now realise that this is way beyond my knowledge.

Hopefully one of the formulae wizards will appear & be able to help
 
Upvote 0
I don't understand the purpose of challenging not to use the same range reference multiple times in the formula.
That makes no sense at all.

Anyhow, here's a way to do it using the same range twice..

MAX EVEN: =AGGREGATE(14,6,1/(MOD(A1:A6,2)=0)*A1:A6,1)
MAX ODD: =AGGREGATE(14,6,1/(MOD(A1:A6,2)=1)*A1:A6,1)
MIN EVEN: =AGGREGATE(15,6,1/(MOD(A1:A6,2)=0)*A1:A6,1)
MIN ODD: =AGGREGATE(15,6,1/(MOD(A1:A6,2)=1)*A1:A6,1)


Now I'll say in general, you can refer to the same range in an almost unlimited number of ways by using offset..

A1:A6
can also be written
OFFSET(B1:B6,0,-1)
or
OFFSET(C1:C6,0,-2)


Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top