Closed Thread
Results 1 to 12 of 12

Excel 2007 : Formula for multiple criteria

  1. #1
    Registered User
    Join Date
    01-29-2010
    Location
    Rowlett, Texas
    MS-Off Ver
    Excel 2007
    Posts
    5

    Formula for multiple criteria


    I am having issues creating a formula that will give me a set value based on multiple criteria.
    Example:
    If Col A="yes"
    AND if Col B="No"
    AND if Col C= "2"
    AND if Col D= "B"
    AND if Col E= "X"
    Then "Col F"
    if not "0"

    I am putting together a multiple sheet workbook that is used as a template to submit to the Medicare. I am currently having to manually look up and enter all information for each discipline. What I want is for a cell to look on another worksheet search data in 5 or 6 columns and if they all match the specific criteria asked for it returns the value listed.

    The data worksheet contains about 1500 lines and 30 columns total...I only need to use a specific few columns, but every line.

    We have tried mutiple/nested if statements and and statements (although not sure I am doing them right) and always get an error about too many criteria.

    Any help would be appreciated, thanks!

  2. #2
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Need formula for multiple criteria

    Hi Mandy1010,

    Please Login or Register  to view this content.
    Otherwise it would help to post a sample workbook.

    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  3. #3
    Forum Contributor
    Join Date
    01-28-2010
    Location
    Riverside, CA
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Need formula for multiple criteria

    Sorry to correct this, but there was a closing parenthesis missing, corrected code, thanks for the 'And' function, I was putting together a string of if statements, but this made it real easy.

    Please Login or Register  to view this content.
    Last edited by teylyn; 01-31-2010 at 03:43 AM. Reason: quote deleted
    Happy Excel'ing!

  4. #4
    Registered User
    Join Date
    01-29-2010
    Location
    Rowlett, Texas
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Need formula for multiple criteria

    Ok I tried that formula and am getting a #Value error, which is better than nothing, but isn't helping me.

    Let me try to better explain. My "Data" is 1500 lines of names, titles, IDs, numbers, dates, figures, dollars, etc. I need to search all 1500 lines and 5 or 6 columns and return a value if all criteria in the same line are true. I created a sample workbook since I can't send my actual data. I am needing the formula to search all lines of data to return the corresponding number to the letter sequence I am searching for. I also left the formula on there with the Value error....maybe I entered something wrong.

    Hopefully the attachment works.

    Data page is the data that needs to be searched and my results page is what I am searching for.

    Thanks again for the help!
    Attached Files Attached Files

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Need formula for multiple criteria

    Hi Mandy,

    Not really quite sure want you are after, but check out the attached.

    If I read it right it almost seems like you require a Vlookup.

    Look on the Data tab and I turned it into a table based off the comments you had.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-29-2010
    Location
    Rowlett, Texas
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Need formula for multiple criteria

    Rocky1

    I had thought that a LOOKUP formula would work but have NEVER used one. I don't know how to read it but I don't think thats coming out right. I attached more specific data for what I am needing.

    I need a formula that will search data and return a specific value, both number and dollar amount, On the attachment I have listed data that resembles what I am needing to search. The results page has the configurations I need it to search and return a value and dollar amount for.

    I have reattached the excel test.

    I know this is confusing, we worked on it for a few hours the other day with no luck.

    There may be no way for us to enter a formula....right now I am manually looking up data and manually transferring information from one worksheet to another. Its easy work but when you have hundreds of these to do, time adds up. We would like for it to be all automatic as soon as the data is downloaded into the template.

    Thanks again everyone!
    Attached Files Attached Files

  7. #7
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Formula for multiple criteria

    Hi Mandy1010,

    If you're willing to separate your search criteria, this may help:

    Cheers,
    Attached Files Attached Files

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula for multiple criteria

    what about on results sheet c1
    =INDEX(Data!$G$1:$G$8,MATCH(A1,INDEX(Data!$A$1:$A$8&Data!$B$1:$B$8&Data!$C$1:$C$8&Data!$D$1:$D$8&Data!$E$1:$E$8,0),0))
    as you have 2007 wrap it up in an iferror
    =iferror(=INDEX(Data!$G$1:$G$8,MATCH(A1,INDEX(Data!$A$1:$A$8&Data!$B$1:$B$8&Data!$C$1:$C$8&Data!$D$1:$D$8&Data!$E$1:$E$8,0),0)),0)
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  9. #9
    Registered User
    Join Date
    01-29-2010
    Location
    Rowlett, Texas
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Formula for multiple criteria

    ConneXionLost

    I cant seperate the results sheet and the data is already seperated so I don't think that will work.

    Martindwilson

    That worked great for the ABCDE example but when I copied and modified it for the 933 W OUT example I am just getting "0" as a result for everything. I might be modifying it wrong but would you mind looking at? I really appreciate it!!

    I have attached the excel workbook with the iferror formula so you could see if I modified it wrong. Thanks again!!
    Attached Files Attached Files

  10. #10
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Formula for multiple criteria

    Hi Mandy1010,

    Because you need to keep your results criteria in one cell, you'll need to account for the spaces you've added in the process. So modifying martinwilson's formula for this gives:

    for cell Results!B10
    Please Login or Register  to view this content.

    and for cell Results!C10
    Please Login or Register  to view this content.


    Cheers,

  11. #11
    Registered User
    Join Date
    01-29-2010
    Location
    Rowlett, Texas
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: Formula for multiple criteria

    Thank you Thank you Thank you.....I tested it with my actual formula and it works perfect....

    Thanks again!!

  12. #12
    Registered User
    Join Date
    11-19-2009
    Location
    CA
    MS-Off Ver
    Excel 2007
    Posts
    62

    Look up last number with criteria

    Hi,

    Would need your expertise on this.

    I'm trying to capture the highest number on a given group. Been playing around with index and match and I can't seem to make it worked.

    For example,

    Group Name, count
    group A, 12
    group A, 13
    group A, 15
    group B, 3
    group B, 2

    the output cell should give me something like:
    Group Name, max count
    group A, 15
    group B, 3

    thanks guys...

Closed Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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