+ Reply to Thread
Results 1 to 8 of 8

IF function and drop-down lists

  1. #1
    Registered User
    Join Date
    09-03-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    IF function and drop-down lists

    Hi,

    I've got an IF statement that's based around what's chosen from a drop-down list. The problem is I'm using "" to stand for nothing being chosen in the cell in question, and this is returning an error message and highlighting the '""' (that looks confusing).

    I've tried checking and unchecking 'ignore blanks' in data validation but nothing much has happened; I have now turned to the internet for help.

    Here's an example of the formula I'm using:

    =IF((AND(C40=A,D40="")),C9,(IF((OR(C40=A,D40=DA)),C9/2,"")))


    The problematic "" is the first one.

    Thank you so much for any help.
    Last edited by NBVC; 09-23-2009 at 02:26 PM. Reason: If I don't mark it solved, will the OP?

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF function and drop-down lists

    are A and DA named cells or text strings.. if text strings they should be enclosed in quotes, other than that, the formula looks ok.

    is there a formula in D40? What error are you getting?
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    09-03-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: IF function and drop-down lists

    They're cells. I can't remember the error message, I restarted excel and excel started accepting the formula. I really have no idea what was going on.

    Thanks though! :P

    I do have one other problem, though. I have this formula, and others, working whenever they damn please. Is there any way to make it so that the only function when a certain cell (say, B2) shows a positive number? Conditional formatting isn't helping.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF function and drop-down lists

    Not sure what you mean...

    you can either turn off Automatic calculations and only have formulas perform calculations when you press F9...

    or. you can alter the formulas to include an IF statement stating something like this:

    =IF(B2>0,do_this,do_that)

  5. #5
    Registered User
    Join Date
    09-03-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: IF function and drop-down lists

    That IF statement idea sounds good; would this be right?:

    changing

    =IF(COUNTA(C40:E40),(COUNTIF(C40:E40,D140)>0)/COUNTA(C40:E40),0)

    to

    =IF((C9>0),IF(COUNTA(C40:E40),(COUNTIF(C40:E40,D141)>0)/COUNTA(C40:E40),0),"")

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF function and drop-down lists

    Yes, that would return a blank cell if C9 is less than or equal to 0.

  7. #7
    Registered User
    Join Date
    09-03-2009
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: IF function and drop-down lists

    Awesome. Sorry, I'm not very good at embedding functions. Thank you!

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: IF function and drop-down lists

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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