# if function with error checking

1. ## if function with error checking

Hello

My file looks like this:

Column
A - number of pieces (manual input)
B - x dimension of area (manual input)
C - y dimension of area (manual input)
D - area based on B and C (formula = B*C)
E - irregular area (manual input, if area is not rectangle)

F- solve for density number (pcs/area)

``Please Login or Register  to view this content.``
``Please Login or Register  to view this content.``
TIA

2. ## Re: help- a simple if function with error checking

Maybe:

You haven't presented enough information to resolve this formula issue..."it doesn't work" is pretty unhelpful:
=IF(AA27="",H27/AB27,IF(ISERROR(H27/AA27),"",(H27/AA27)))

This formula should also work, even when B or C is blank.
=IF(D1=0,A1/E1,IF(ISERROR(A1/D1),"",(A1/D1)))

There must be something else going on you have not presented. Click GO ADVANCED and use the paperclip icon to post up your workbook, let us see what else might be going on.

3. ## Re: if function with error checking

thanks JBeaucaire,

see attached.. Cell F6 should be zero or blank.

I think i have to add column A to the IF condition.

thanks

4. ## Re: if function with error checking

Feel free to share if you have a better one
thanks

``Please Login or Register  to view this content.``

5. ## Re: if function with error checking

Hi,
Looking at your attachment, you formula is doing exactly what it should.
I think the problem my be that you do not have anything to treat an error where you are D6 = 0 AND E6 is empty or equals zero.

Not sure what you want to happen where both D6 and E6 are empty or zero...

6. ## Re: if function with error checking

Oops, sorry didn't see you had found a solution.

Your solution works fine if there is nothing in cell A2, but will not work if you have a number in cell A2.

Try replacing your
``Please Login or Register  to view this content.``
with

``Please Login or Register  to view this content.``
This will test if the Length of any entry in cell A2 is 0, and if is zero then ""

7. ## Re: if function with error checking

thanks Jbentley

more power

edit: i found the best solution according to my needs:

``Please Login or Register  to view this content.``

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1