Trouble with Formula

HuckFinn

New Member
Joined
Aug 1, 2006
Messages
45
Ok, I am stuck. My current formula: =IFERROR(IF(COUNTIFS(INDIRECT($D$3),A8,INDIRECT($D$3),">0"),COUNT(IF(INDIRECT($D$3)=$A8,INDIRECT($D$3)))),"--") returns a FALSE, when I assumed it would return a " -- " due to meeting the condition outlined in the formula (i.e., there were no instances that matched A8.

Any thoughts on where I am going wrong?
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
It is important to understand the differences between IF and IFERROR. They are NOT similar.

The IF function has three arguments:
=IF(condition, what to do if condition is TRUE, what to do if condition is FALSE)

The last argument is optional. If you leave it off, and the condition is not met, the formula will return FALSE, by default.

The IFERROR function has two arguments:
=IFERROR(what to return, what to return if previous argument results in an error)
what to return may be a calculation or a cell reference

So, the second argument is what to return if the first argument results in some sort of error (like #N/A or #DIV/0).

Note that FALSE is NOT an error. If the first argument evaluates to FALSE, that that is what the IFERROR calculation will return.


When trying to debug formulas that aren't working correctly, I usually find the best thing to do is start with the inner-most calculation.
Do that and see what that returns. If that works properly, then keep building out, and check the next calculation.
Continue on until you find the error or get to your complete formula.
 
Upvote 0
Ahh. Thank you!

This formula worked:

IF(COUNTIFS(INDIRECT($D$3),A6,INDIRECT($D$3),">0"),COUNT(IF(INDIRECT($D$3)=$A6,INDIRECT($D$3))),"--")
 
Upvote 0
You are welcome.
 
Upvote 0

Forum statistics

Threads
1,214,839
Messages
6,121,892
Members
449,058
Latest member
Guy Boot

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