Using IFERROR in conjunction with array formula

Wookiee

Active Member
Joined
Nov 27, 2012
Messages
440
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
I currently have a spreadsheet which examines a range of cells (date formatted) and determines the oldest and newest dates using MAX and MIN formulas. However, I've recently revised the method by which the source data cells determine the date values so that they utilize array formulas. Previously, they used a VLOOKUP formula so that a dash appears in the cell if no date value was returned. It went something like this:

=IFERROR(VLOOKUP($A20,wsSource!$A:$C, 3, 0), "-")

I changed the formula to an array formula, however now I'm unable to figure out how to produce the dash value if the cell with the lookup data does not return a value. Now I have a bunch of "1/0/00" cells whereas they used to simply reflect dashes. And that wreaks havoc with my MIN and MAX formulas in another part of the spreadsheet.

So I can conceive of two different methods to solve my problem, but I've been unable to figure out how to achieve my desired results.

The first thought I had was to try and combine IFERROR (or IF arrayresult = 0) so that it would display a dash. But I couldn't construct a formula without Excel throwing an error message. I've seen cases where an array could be manually keyed in the middle of a formula without the CTL+SHIFT+ENTER, but I couldn't replicate that function.

The other thought that occurred to me was to revise my MIN formula so that it ignores any values of zero. Currently my MIN formula is:

=IF(MIN(F19:F37)=0, "-", MIN(F19:F37))

As I was composing this, it occurred to me that I could add an extra bit of VBA code to this process to loop through the results and switch all date values of 0 to the dash character, but I would prefer to be able to use a formula. Can anyone suggest an efficient formula for this situation?
 
Here is Dunn's code for the V() function. It allows one to avoid performace degradation due repeating complex calculations in a formula

Excellent! I've always hated having to include redundant calculations in my formulas. And this should make my VBA code much less cumbersome, as well. Thanks for all your help. I love this forum!
 
Upvote 0

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Excellent! I've always hated having to include redundant calculations in my formulas. And this should make my VBA code much less cumbersome, as well. Thanks for all your help. I love this forum!

Great. Thanks for providing feedback. And a happy new year.
 
Upvote 0

Forum statistics

Threads
1,221,527
Messages
6,160,342
Members
451,638
Latest member
MyFlower

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