• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Smallest in Range every 'th

tiong999

Member
Hello

Supposed i want to get the smallest value between range of every 'th column interval.
Please review my sample doc attached for better illustration.

For any feedback, i appreaciated so much.

Regards,
Tiong
 

Attachments

  • Smallest in Range every 'th.xlsx
    9.2 KB · Views: 5
Hello buddy....thanks for your review.

But suppose table is not so short...so i adapt your formula as my layout

MIN(C3,N(OFFSET(F3,,(COLUMN()-3)*3+1)))

Thanks for your kindness buddy.

Regards,
Tiong
 
I'm sorry for my bad illustration.
Actually your formula is okay...but this consume time and fragile for human error when my Table is far Larger than the example.

Please review my expected result.

Regards,
Tiong999
 

Attachments

  • Smallest in Range every 'th (3).xlsx
    9.1 KB · Views: 7
I'm sorry for my bad illustration.
Actually your formula is okay...but this consume time and fragile for human error when my Table is far Larger than the example.

Please review my expected result.

Regards,
Tiong999
If you have a longer table, your can use this array formula instead.

=MIN(C3,N(OFFSET(F3,,ROW(INDIRECT("1:"&ROUNDUP((MATCH(9^9,3:3)-COLUMN(F3))/3,0)))*3-2)))

p.s. Array formula to be confirmed by pressing SHIFT+CTRL+ENTER 3 keystrokes together.

Regards
Bosco
 
hello,

Im actually hard to digest formula.
May u explained us how the formula translate it (especially which in underlined pink color part)?

MIN(C3,N(OFFSET(F3,,ROW(INDIRECT("1:"&ROUNDUP((MATCH(9^9,3:3)-COLUMN(F3))/3,0)))*3-2)))


Regards,
Tiong999
 
hello,

Im actually hard to digest formula.
May u explained us how the formula translate it (especially which in underlined pink color part)?

MIN(C3,N(OFFSET(F3,,ROW(INDIRECT("1:"&ROUNDUP((MATCH(9^9,3:3)-COLUMN(F3))/3,0)))*3-2)))


Regards,
Tiong999
upload_2017-6-27_19-36-8.png

To get the smallest value of every 3rd in "Table" range and single value in "Data"

In C5 array (CSE) formula :

{=MIN(C3,N(OFFSET(F3,,ROW(INDIRECT("1:"&ROUNDUP((MATCH(9^9,3:3)-COLUMN(F3))/3,0)))*3-2)))}

the red color portion MATCH(9^9,3:3) return the last numeric value position in Row no 3, this give 16

become >>

{=MIN(C3,N(OFFSET(F3,,ROW(INDIRECT("1:"&ROUNDUP((16-6)/3,0)))*3-2)))}

and,

ROW(INDIRECT("1:"&ROUNDUP((16-6)/3,0)))*3-2 returns you array {1;4;7;10}

>>

{=MIN(C3,N(OFFSET(F3,,{1;4;7;10})))}

>>

=1 (desired result)

Regards
Bosco
 
Hello Bosco,

Thanks, u lead me know deeper excell trick.

But, suppose 1 of long table range cell contain blank (example cell J3=empty)...it will return 0 instead 3 as the minimum result i expected.
And the fact many cell will contain blank cell in long run table.
How am i supposed to modified the formula?

Btw, why must /3 as for ROUNDUP((16-6)/3,0) ??

Regards,
Tiong999
 
Last edited:
Hello Bosco,
But, suppose 1 of long table range cell contain blank (example cell J3=empty)...it will return 0 instead 3 as the minimum result i expected.
And the fact many cell will contain blank cell in long run table.
How am i supposed to modified the formula?
Tiong999
upload_2017-6-27_20-47-48.png

If Data/Table Range cell contain blank or 0, you want result to exclude 0.

Then, in C5 array (CSE) formula :

=MIN(IF(CHOOSE({1,2},C3,N(OFFSET(F3,,ROW(INDIRECT("1:"&ROUNDUP((MATCH(9^9,3:3)-COLUMN(F3))/3,0)))*3-2)))>0,CHOOSE({1,2},C3,N(OFFSET(F3,,ROW(INDIRECT("1:"&ROUNDUP((MATCH(9^9,3:3)-COLUMN(F3))/3,0)))*3-2)))))

p.s. Array formula to be confirmed by pressing SHIFT+CTRL+ENTER 3 keystrokes together.

Regards
Bosco
 
Last edited:
Hello Bosco,
............
Btw, why must /3 as for ROUNDUP((16-6)/3,0) ??
Tiong999
To get every 3rd value position in "Table" range.

=ROW(INDIRECT("1:"&ROUNDUP((16-6)/3,0)))*3-2

>>

=ROW(INDIRECT("1:"&ROUNDUP(10/3,0)))*3-2

>>

=ROW(INDIRECT("1:"&ROUNDUP(3.33333333333333,0)))*3-2

>>

=ROW(INDIRECT("1:"&4))*3-2

>>

={1;2;3;4}*3-2

>>

={3;6;9;12}-2

>>

={1;4;7;10}

Regards
Bosco
 
=MIN(IF(CHOOSE({1,2},C3,N(OFFSET(F3,,ROW(INDIRECT("1:"&ROUNDUP((MATCH(9^9,3:3)-COLUMN(F3))/3,0)))*3-2)))>0,CHOOSE({1,2},C3,N(OFFSET(F3,,ROW(INDIRECT("1:"&ROUNDUP((MATCH(9^9,3:3)-COLUMN(F3))/3,0)))*3-2)))))

Bosco

Sorry, i just played this formula and i get N/A as result.

Will u review it. I appreciated for your contribution.


Regards,
Tiong999
 
@bosco_yip Interesting solutions and amazing explanation :awesome:

@tiong999 Here is one other formula to get the answer. I may have misunderstood the problem. But assuming you want the minimum of user input (C3) or every 3rd item in a range (G3 : P3), you can use below formula as well.

=MIN($C$3,IF(MOD(COLUMN($G$3:$P$3)-COLUMN($F$3),3)=1,IF($G$3:$P$3<>0,$G$3:$P$3)))

Press CTRL+Shift+Enter to get the answer.
 
Back
Top