+ Reply to Thread
Results 1 to 6 of 6

Help please

  1. #1
    Forum Contributor
    Join Date
    02-16-2006
    Posts
    200

    Unhappy If statement

    Can anyone help with the following formula

    I need to return a result in cell AC31 (formatted as %) based on the following;

    If AA31 =0 then AB31/Z31
    If AA31 <>0 then AB31/AA31

    Ta
    Last edited by VBA Noob; 03-08-2007 at 06:52 PM.

  2. #2
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Please Login or Register  to view this content.
    Then Format Cells Number Percentage


    HTH
    Carim

  3. #3
    Forum Contributor
    Join Date
    02-16-2006
    Posts
    200

    Unhappy

    thanks for reply - this is the formula I too came up with but it doesnt seem to address the 2nd part where AA31 <>0 i.e. an either or scenario

    PLease let me know if you need further explanation

    Thanks

  4. #4
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Sorry ...

    But the if() function operates as follows ...

    =IF(logical_test,value_if_true,value_if_false)

    i.e. the two possibilities True and False resulting from the test ...

    HTH
    Carim

  5. #5
    Forum Contributor
    Join Date
    02-16-2006
    Posts
    200

    Cool

    correct - it does work - many thanks

    is there anyway that I can avoid the #div/0! sign when cells are blank?

  6. #6
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474
    Try...

    =IF(AA31<>0,AB31/AA31,IF(Z31<>0,AB31/Z31,""))

    Hope this helps!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Bookmarks

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