+ Reply to Thread
Results 1 to 4 of 4

Need help with an if=then formula

  1. #1
    Registered User
    Join Date
    04-24-2012
    Location
    Western WA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question Need help with an if=then formula

    edit: My mistake, if b equals less than a it will display 0%. Otherwise having N/A display instead of #DIV/0 would be nice, it's not real necessary.





    I am trying to make a formula for the followig question:

    a= Number of deliveries
    b= delivered on time
    c= called with an updated arrival time (asked only if customer answers no to b)

    Originally I used =c/(a-b) However the problem with that is if everyone was delivered on time then I have "blank" for c which gives me #DIV/0! Or if the answer is 0 I also get #DIV/0!

    Can I have a forumla so that if c="blank" then display N/A, if c=0 then display "0%", if there's any other number then =c/(a-b) ?

    Thank you for your help.
    Last edited by lathode; 04-24-2012 at 02:12 PM.

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887

    Re: Need help with an if=then formula

    Hi Lathode, welcome to the forum.

    Perhaps try:

    =IF(AND(ISNUMBER(C1),C1=0),0,IF(C1="",NA(),C1/(A1-B1)))

    Note, if you want to return the text "N/A" instead of the error #N/A, replace NA() with "N/A".

  3. #3
    Registered User
    Join Date
    04-24-2012
    Location
    Western WA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Need help with an if=then formula

    Thank you for your help Paul, this looks like a great site. Glad I found it through Google.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,423

    Re: Need help with an if=then formula

    Try this (and relate it to how you have asked the question):

    =IF(c="","n/a",IF(c=0,0,IF(a=b,0,c/(a-b))))

    Format the cell as percentage (and unless a, b and c are named values, insert the appropriate cell references for them).

    Hope this helps - if so, mark the thread as Solved (the FAQ tells you how).

    Pete

+ 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