ignoring blank cells in an array forumla

ENAPo

New Member
Joined
May 16, 2013
Messages
23
I have this formula in a cell:
=IF(ISERROR(INDEX($R$1:$AF$5000,SMALL(IF($R$1:$AF$5000=$Q$1,ROW($R$1:$AF$5000)),ROW(5:5)),5)),"",INDEX($R$1:$AF$5000,SMALL(IF($R$1:$AF$5000=$Q$1,ROW($R$1:$AF$5000)),ROW(5:5)),5))

If the cell it's pulling the information from is blank it puts a 0 in the cell. I want it to just leave it blank if the cell is blank but am at a loss where to put that in the formula. Hope that doesn't sound confusing.

Thanks!!
 
It is super secret. :)
6
10/31/2013
14578
Butter County
3
10/16/2013
15489
Cream County
2
10/6/2013
45879
Cheese County
6
11/02/2013
45684
Butter County

<TBODY>
</TBODY>







This is what I need to do and I hope I explain it right. I have a large amount of information with 15 columns and up to 2000+ rows, that I paste/import into Excel from Quickbooks. I have a drop down box that lists products that coincides with the numbers in the above table. (6,3...). When I select a product from the drop down menu, I want it to populate all the information in my 2000+ rows that equals the number into another section of the worksheet. Ideally, I would like a new worksheet separate from the main information. For instance, #6 is populated in cell Q1 when I select the product from the drop down menu. So in another worksheet or area of table, I want everything in that row that equals 6 to be populated and however many rows has 6. Does that make any sense? I basically want a whole other table that filters for only the item that I have selected. I need to show this to others and I would rather not have them mess with filtering. I would be REALLY nice if I can have it filter based on the month that is populated in A1 as well. For instance, only give me every line that equals 6 and is in the month of October. I am really new to all these formulas in excel and am trying my best. Not trying to be aloof.

Sheet1, A:D, houses the relevant data.

Product
Date
Code
Location
6
10/31/2013
14578
Butter County
3
10/16/2013
15489
Cream County
2
10/6/2013
45879
Cheese County
6
11/2/2013
45684
Butter County
2
11/21/2013
45953
Cheese County
6
11/21/2013
45785
Butter County

<TBODY>
</TBODY>

Sheet2, A:E, houses the processing...

Nov
6
IdxProductDateCodeLocation
464158045684Butter County
664159945785Butter County

<COLGROUP><COL style="WIDTH: 48pt" width=64><COL style="WIDTH: 67pt; mso-width-source: userset; mso-width-alt: 3157" width=89><COL style="WIDTH: 59pt; mso-width-source: userset; mso-width-alt: 2816" width=79><COL style="WIDTH: 69pt; mso-width-source: userset; mso-width-alt: 3271" width=92><COL style="WIDTH: 130pt; mso-width-source: userset; mso-width-alt: 6144" width=173><TBODY>
</TBODY>

A1: Mar (a month of interest, given as a literal month name)

A2: 6 (a product of interest, selected from the dropdown list in this cell)

A5, control+shift+enter, not just enter, and copy down:
Rich (BB code):
=IFERROR(SMALL(IF(Sheet1!$A$2:$A$7=$A$2,
  IF(Sheet1!$B$2:$B$7-DAY(Sheet1!$B$2:$B$7)+1=(1&$A$1)+0,
  ROW(Sheet1!$A$2:$A$7)-ROW(Sheet1!$A$2)+1)),ROWS($A$5:A5)),"")

B5, just enter, copy across as far as needed, and down:
Rich (BB code):
=IF($A5="","",INDEX(Sheet1!A$2:A$7,$A5))

Note 1. If so desired, A1 can house a true date like 1-Nov-13, custom-formatted either Nov-13 or Nov.
Note 2. If so desired, the references to the data area can be set up as references to dynamic named ranges.
 
Last edited:
Upvote 0

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Sorry - I think I get it now :).
I put my own data into the cells you've used in order to demonstrate the different results?. I'm afraid I'm good at missing the obvious sometimes..........

Thanks very much for your help.

Hercules

You're welcome.

Markmzz
 
Upvote 0
Another way:

Layout

Header01Header02Header03Header000004Header05Header06Header07Header08Header09Header10Header11Header12Header13Header14Header15Sheet1
631/10/201314578Butter County4949293395461556292773
316/10/201315489Cream County 267584 42 912259
206/10/201345879Cheese County1119935793106840648122
606/10/201345684Cheese County56 531835 729399 78
616/10/201314578 8658878036679749239327
316/10/201315489Cream County8059599682944046237794
206/10/201345879Cheese County9149694465 93855970
602/11/201345684Butter County9112308023884046566776
330/10/201343711 59906628645116127385

<colgroup><col width="53" style="width: 40pt; mso-width-source: userset; mso-width-alt: 1938;"> <col width="63" style="width: 47pt; mso-width-source: userset; mso-width-alt: 2304;"> <col width="53" style="width: 40pt; mso-width-source: userset; mso-width-alt: 1938;"> <col width="77" style="width: 58pt; mso-width-source: userset; mso-width-alt: 2816;"> <col width="53" style="width: 40pt; mso-width-source: userset; mso-width-alt: 1938;" span="11"> <col width="40" style="width: 30pt; mso-width-source: userset; mso-width-alt: 1462;"> <tbody>
</tbody>

Header01Header02Header03Header000004Header05Header06Header07Header08Header09Header10Header11Header12Header13Header14Header15Sheet2
610/201314578Butter County4949293395461556292773
45684Cheese County56 531835 729399 78
14578 8658878036679749239327
37029Cheese County9122592850867160362124
29870 7788401388673682809113
53955Cheese County2774619335431220403716
25052Cream County9366116998958381753424
34201 3745618669138182132149
30406Cheese County 36449060895526965860

<colgroup><col width="54" style="width: 41pt; mso-width-source: userset; mso-width-alt: 1974;" span="3"> <col width="77" style="width: 58pt; mso-width-source: userset; mso-width-alt: 2816;"> <col width="54" style="width: 41pt; mso-width-source: userset; mso-width-alt: 1974;" span="11"> <col width="40" style="width: 30pt; mso-width-source: userset; mso-width-alt: 1462;"> <tbody>
</tbody>


Formula

Code:
In C2 (in Sheet2) - use Ctrl+Shift+Enter and not only Enter to enter the formula

=IFERROR(INDEX(IF(Sheet1!C$2:C$2500="","",Sheet1!C$2:C$2500),
SMALL(IF(Sheet1!$A$2:$A$2500=$A$2,IF(TEXT(Sheet1!$B$2:$B$2500,"mmyy")=
TEXT($B$2,"mmyy"),ROW(Sheet1!$A$2:$A$2500)-ROW(Sheet1!$A$2)+1)),ROWS(C$2:C2))),"")

And copy to the right and down.


Markmzz
 
Upvote 0

Forum statistics

Threads
1,215,349
Messages
6,124,427
Members
449,158
Latest member
burk0007

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