A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
Nancy wrote:
I'm trying to write a formula and running into trouble. The problem is I need to write a nested IF that includes an OR and an ISERROR. I receive a spreadsheet from a supplier regarding stock available to me and I need to calculate the Unit Price (which changes daily because this is fruits and veggies).
Since I don't create this spreadsheet, I can't control how they supply the information. Worse yet, they tend to leave blank lines every once in a while, so I get Div/0 showing up
[....]
To me the logical formula in column E, row 3 (actually every row) would read =IF(OR($A3="N/A", ISERROR(C3/D3),""))
This is not acceptable, but I can't find anything that will tell me HOW to do this correctly.
It is not uncommon to want to use ISERROR even though your are using Excel 2007. Even though Excel 2007 has the IFERROR function, which is more efficient to use, ISERROR should be [1] used in compatibility mode; that is, in workbook that has an "xls" extension. And that might very well be the case since the workbook comes from someone else, or if you want to make sure the workbook is usable by the broadest group of users.
So to answer your question, you might write:
=IF(OR(A3="N/A",ISERROR(C3/D3)),"",C3/D3)
[1] Technically, Excel 2007 and later permits us to use IFERROR in compatibility mode. But we get a compatibility warning when we save the file (unless that option is disabled). And the file is usable if it is opened in Excel 2003.