Help reqd. in Index array function. Blank cells to be shown as "".

Occasional Contributor

There are 2 screen shots.In pic 1 (Sheet name - "Emp")

Referring $D$12 (Emp. code), I have displayed Dealer codes from H23 to H32 (as shown in pic) using below array formula.




Purpose of using this array formula is to show max 10 dealer codes at a time. If there are less dealers, say 4 dealers, then 4 codes will be displayed.

Referring pic 2 (Sheet name - "Main" in the same workbook)

Emp. code is also driven by below formula from "Main" sheet




My problem is if an Emp. code is blank in "Main"sheet then $D$12 shows 0 (pic 3 & pic 4).

And cell H23 to H32 still shows dealer codes calculating from H6 (from "Main" sheet) and so on..


I need if $D$12 is 0 or "-" or blank, H23 to H32 should be blank.  If anybody can correct or simplify my formula, please help.2.jpg1.jpg

5 Replies
Best Response confirmed by Sarav45 (Occasional Contributor)


Try this: 





hi..Great thanks for reply.. this formula is giving incorrect results.
Above formula is working good but with a slight range change. I have to take whole column range to get correct results. If taking range H6:H2000, it is calculating 1st result (Nth row) from H6. So I selected whole column to solve this.
Here it is :

How can I take specified range say H6:H2000 only, just in case to avoid extra calculations in excel file.


You may define dynamic ranges, like this: 



thanks a ton..You are a gem..!!
You’re very much welcome!