+ Reply to Thread
Results 1 to 11 of 11

Using "If" and "And" in a formula to return a value/number

  1. #1
    Registered User
    Join Date
    09-19-2008
    Location
    maryland
    Posts
    23

    Using "If" and "And" in a formula to return a value/number

    I hope this is the correct place to post this and if it isn't I apologize in advance. I have included a small sample of the spreadsheet I'm trying to use in a larger one.

    The goal is simple, "If" you select "Yes" to Health insurance, "and" if you select "HMO", I'd like to have the cost for the "HMO" returned in the "Health Cost" cell. The same would hold true for "POS" with the returned cost being the one for "POS." I have started what I think is the right way to do this but so far it's just returning "True" or "false". I didn't go any further with the formula given the simple aspects are not working yet.

    Thanks in advance,

    Ed
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    03-12-2013
    Location
    Viet Nam
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: Using "If" and "And" in a formula to return a value/number

    You use this formulas
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Using "If" and "And" in a formula to return a value/number

    Hi - Try this in F6 and below:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Hope this helps...
    If solved kindly remember to mark Thread as solved.
    Click the small star icon at the bottom left of my post if this was useful.

  4. #4
    Registered User
    Join Date
    09-19-2008
    Location
    maryland
    Posts
    23

    Re: Using "If" and "And" in a formula to return a value/number

    You folks are great and I appreciate the prompt relies.

    It works if I select HMO but not if I select POS. Additionally, the costs for the HMO and the POS are going to be on a seperate "Variable/Assumtions page (creating a budget with multiple sheets and multiple variable that can be changed) so I would need the caculation to pull the "value" from a specific cell

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using "If" and "And" in a formula to return a value/number

    Try this:

    =SUMIFS(Cost,Choice,D6,Health,E6)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Registered User
    Join Date
    09-19-2008
    Location
    maryland
    Posts
    23

    Re: Using "If" and "And" in a formula to return a value/number

    It just returns "#Name?" with no number.

  7. #7
    Forum Contributor
    Join Date
    09-27-2012
    Location
    London, England
    MS-Off Ver
    2003, 2010
    Posts
    344

    Re: Using "If" and "And" in a formula to return a value/number

    Quote Originally Posted by edbhome View Post
    ....It works if I select HMO but not if I select POS.
    Not sure if i follow this. Look at the attached file, seems to work.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    09-19-2008
    Location
    maryland
    Posts
    23

    Re: Using "If" and "And" in a formula to return a value/number

    The sheet you sent me works for the first line, but not the second. Maybe I need to restate this ... lets use row "6" as the example, what I'm after is the ability to select if they have health care (Yes/No), then if they do ... you select the type of health care(HMO/POS) and depending on which type you select it pulls the "cost" from the repsective cells ie. if it's HMO then the cost ($400) of HMO (cell K5) gets put into cell F6. If you select POS then the value in cell K6 ($500) gets put into the F6 ... anything else returns either nothing in F6 or $0.00. The same logic goes for row 6 and so on.

    Hope this helps to clarify what I'm attempting to do.

    As always, I thank everyone for thier assistance. You folks are awsome.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using "If" and "And" in a formula to return a value/number

    You already have the named ranges Choice and Health so I assumed you would also create the name Cost.

    If not just use the range address of the Cost column:

    =SUMIFS(K$5:K$6,Choice,D6,Health,E6)

  10. #10
    Registered User
    Join Date
    09-19-2008
    Location
    maryland
    Posts
    23

    Re: Using "If" and "And" in a formula to return a value/number

    Thanks to all of you for your assistance. I will mark the thread solved.

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using "If" and "And" in a formula to return a value/number

    You're welcome. We appreciate the feedback!

+ 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