Applying Array formula on the results of another array formula

Usercode

Board Regular
Joined
Aug 18, 2017
Messages
107
Office Version
  1. 2016
Platform
  1. Windows
I have this formula
Code:
{=SMALL(N2:R2,{1,2,3,4,5})}
in (U2:Y2), when I try to use this formula
Code:
=IFERROR(INDEX($U2:$Y2,SMALL(IF($U2:$Y2=0,COLUMN($U2:$Y2)),COLUMN(U:U))),"")
on (AB2:AF2), It doesn't give any error or result. But I know this formula works, I used it before. Can it be the reason that I use =small() function on U2:Y2. Can you help me fix the problem? please. thanks.
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Perhaps the question is what are you trying to achieve? In decomposing your second formula, it looks like you're looking for 0 values in U2:Y2, and if you find one, you're putting it into AB2:AF2. Why not just put 0 there directly? Or did you mean to have the INDEX point to $U1:$Y1 or something?

Your likely problem is the COLUMN(U:U) at the end. That will return 21 in AB2, 22 in AC2, etc., and your array only has 5 values in it. Did you want to use COLUMNS($U:U) instead?
 
Upvote 0
I tried your suggestion COLUMNS($U:U), but it didn't make any difference. What I want to do as in this example, extract "0s" from the from U2:Y2 and them put them into "AB2:AF2". and they will be lined up in AB2:AF2.
 
Upvote 0
When I put my raw data in A1:V1 columns, and this formula
Code:
=IFERROR(INDEX($A3:$V3,SMALL(IF($A3:$V3=0,COLUMN($A3:$V3)),COLUMN(A:A))),"")
in X1:Z1 columns, it works. but when I try to do it on the results of an array formula, it doesn't work.
 
Last edited:
Upvote 0
You could just put this formula in AB2 and drag right:

=IF(COLUMNS($AB:AB)<=COUNTIF($U$2:$Y$2,0),0,"")

If you want to use an array formula, select the range AB2:AF2, and enter this formula:

=IFERROR(SMALL(IF($U$2:$Y$2=0,0,""),{1,2,3,4,5}),"")

and confirm with CSE.
 
Upvote 0
These formulas work, if there is a 0, it puts a 0 to AB1. But if there are two, three or four 0s, it doesn't put other zeros to the next columns. The original formula puts one 0 in the target cell, if there are two or more 0s, it puts them into the next cells in defined range.
 
Upvote 0
Sorry, my mistake. they do the job. I corrected it now. thanks a lot. I will use these formulas.
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,318
Members
452,634
Latest member
cpostell

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