Ignore blank cells on matched values with multiple results

edgillenw

New Member
Joined
Oct 1, 2015
Messages
7
Excel 2013 Windows 10 Surface Pro 3

I am creating a training database where each employee has a training sheet and then I have a summary sheet that looks at each individual sheet, determines if the training is past due, and returns the name of the necessary training course.


Example Training Sheet:
Column AColumn BColumn CColumn D
Training CourseFrequency (yrs)Training DateTraining Due Date
First Aid11/1/20151/1/2016
Electrical Safety11/1/20151/1/2016
House Keeping11/1/20151/1/2016
Demonstrated experienceOne Time1/1/2015---

<tbody>
</tbody>
I have the training due date set to auto calculate and use conditional formatting to alert me of past due, upcoming in 30 days and upcoming in 90 days. <now()cell value="" <now()+30
<now()=60
However, as the number of employees grows it is too difficult to look at each individual page each month. Therefore, I want a summary sheet.

Summary Sheet:
I found a formula on a previous post that can be used to return the value I want and allows for multiple results. Cell G8 referenced below is where my formula resides on the sheet.

=IF(COUNTIF($D$5:$D$120,NOW()) <=ROWS($G$8:G8), INDEX($A$5:$A$120,SMALL(IF($D$5:$D$120<=NOW(),
ROW($D$5:$D$120)-ROW($D$5)+1),ROWS($G$8:G8))),"")</now()=60
</now()cell>

<tbody>
</tbody>

My issue is that in the rows where column D is blank, the formula still returns the text written in column A. I tried changing the beginning of my formula to include IF($D$5:$D$120="","",(COUNTIF... however that does not change anything. I believe the issue lies in the COUNTIF statement.

Specific question: How can I use the above formula while ignoring blank cells in column D? Help on this will be greatly appreciated!!!
 
Last edited:

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Try:
This is an array formula and must be entered with CTRL-SHIFT-ENTER

Code:
=IF(COUNTIF($D$5:$D$120,[COLOR=#ff0000]"<"&[/COLOR]NOW()) [COLOR=#ff0000]>=[/COLOR]ROWS($G$8:G8),INDEX($A$5:$A$120,SMALL(IF($D$5:$D$120<=NOW(),[COLOR=#ff0000]IF($D$5:$D$120<>""[/COLOR],ROW($D$5:$D$120)-ROW($D$5)+1)[COLOR=#ff0000])[/COLOR],ROWS($G$8:G8))),"")
 
Upvote 0
Thank you very much!!! Your edits to the formula seem to be solving my problem. AMAZING!
 
Last edited:
Upvote 0
I have another question. I am trying to extend this model to include due in 30 days and due in 60 days as well. I naively assumed I could just change the NOW() to NOW()+30 and NOW()+60 but that doesn't seem to work. Any ideas?
 
Upvote 0
A couple of options:
Both are array formulas.

Code:
=IF(COUNT(IF($D$5:$D$120>=NOW()-[COLOR=#ff0000]30[/COLOR],IF($D$5:$D$120<=NOW(),IF($D$5:$D$120<>"",ROW($D$5:$D$120)-ROW($D$5)+1))))>=ROWS($G$8:G8),INDEX($A$5:$A$120,SMALL(IF($D$5:$D$120>=NOW()-[COLOR=#ff0000]30[/COLOR],IF($D$5:$D$120<=NOW(),IF($D$5:$D$120<>"",ROW($D$5:$D$120)-ROW($D$5)+1))),ROWS($G$8:G8))),"")
Change the 30 to 60 for 60 days.

A short version would be to use the IFERROR function. This would run a little slower, but with only 115 rows you probably won't see a difference.

Code:
=IFERROR(INDEX($A$5:$A$120,SMALL(IF($D$5:$D$120>=NOW()-30,IF($D$5:$D$120<=NOW(),IF($D$5:$D$120<>"",ROW($D$5:$D$120)-ROW($D$5)+1))),ROWS($G$8:G8))),"")
 
Upvote 0
I tried both and they both work with the same result, which was unfortunately not the result I want. Both of these options provided me the items that were past due but not the items that will be due in the next 30 days or next 60 days.
 
Upvote 0
I kept messing around with the code of the short version and finally figured it out. Still couldn't figure out the long version.

Code:
=IFERROR(INDEX($A$5:$A$120,SMALL(IF($D$5:$D$120[COLOR=#ff0000]<[/COLOR]NOW()[COLOR=#ff0000]+[/COLOR]30,IF($D$5:$D$120[COLOR=#ff0000]>[/COLOR]=NOW(),IF($D$5:$D$120<>"",ROW($D$5:$D$120)-ROW($D$5)+1))),ROWS($G$8:G8))),"")
 
Upvote 0
Glad you got it to work. Sorry, I misunderstood what you were looking for on the 30 & 60 days.
 
Upvote 0

Forum statistics

Threads
1,214,622
Messages
6,120,580
Members
448,972
Latest member
Shantanu2024

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