+ Reply to Thread
Results 1 to 12 of 12

'If' conditions on multiple criteria and rows

  1. #1
    Registered User
    Join Date
    01-08-2012
    Location
    Zwijndrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    20

    'If' conditions on multiple criteria and rows

    I tried different possibilities to combine the following conditions:
    condition 1: state (column D) 'vrijgegeven' has to be true
    condition 2: 'vrijgegeven' has to be done between 1-1-2015 en 31-12-2015 (column C)
    condition 3: If number in column A appears more than one time then condition 4 has to be activated
    condition 4: if date in 'selectie start' (column B) is between now and 1-12-2015 and the number in column A appears more then one time the answer in column I is: 'reminder' otherwise: 'geen reminder'

    At this moment I can only get a formule that gives me an answer in the corresponding row without looking to the rows from the same number (column A). So condition 4 is my biggest problem.

    Can anyone help me with this case?
    Attached Files Attached Files

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

    Re: 'If' conditions on multiple criteria and rows

    I'm not sure that you have covered all conditions in your description, but try this in I2:

    =IF(AND(D2="vrijgegeven",YEAR(C2)=2015,COUNTIF(A:A,A2)>1),"reminder","geen reminder")

    Note that you may need to use semicolons ( ; ) instead of commas ( , ) in the formula, depending on your regional settings, then you can copy the formula down as required.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    01-08-2012
    Location
    Zwijndrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: 'If' conditions on multiple criteria and rows

    Pete, thanks a lot for your help so far.
    Indeed the (,) should be (; ) in my Excel. The solution you suggested gives reminders and non-reminders for the same business (column A).
    I hoped to manage it in a way that if in column B for one business (column A) there is a data after 1-12-2015, I dont get an answer 'reminder' in I. '
    Now you see business (see attachment 205 (in red)) has two 'reminders' and one 'geen reminder'.
    In this case i would like to have 'geen reminder' for all business rows 205 in column I because there is a data younger (B9) than 1-12-2015 so this business don't need a reminder.
    is this description clear to you?
    Attached Files Attached Files
    Last edited by AliGW; 12-28-2020 at 04:37 AM. Reason: PLEASE don't quote unnecessarily!

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,045

    Re: 'If' conditions on multiple criteria and rows

    Assuming that 1-12-2015 is December 1st 2015 and not January 12th 2015 then the following may work (paste into cell I2 and drag the fill handle down):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    If the above formula does not yield the desired results then it would be helpful to manually place the desired results so that we will have something with which to compare the results of our proposed formulas/code.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    01-08-2012
    Location
    Zwijndrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: 'If' conditions on multiple criteria and rows

    JeteMc,
    Thanks for your support!
    As you can see in the Excel-attachment (version 1.3) it works for the company's that appear more than ones in column A (in red), but it gives a wrong answer (orange in row 211). This is in my opinion due to the condition IF(AND(OR(D2="vrijgegeven";AND(COUNTIFS(A$2:A$18;A2)>1;COUNTIFS(A$2:A$18;A2;D$2:D$18;"vrijgegeven"))) because this will lead to twice 'FALSE', and therefore the result 'reminder'.

    So I think we're on the good road, but still not where we supposed to be.
    Still new suggestions?
    Attached Files Attached Files
    Last edited by AliGW; 12-28-2020 at 04:37 AM. Reason: PLEASE don't quote unnecessarily!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,234

    Re: 'If' conditions on multiple criteria and rows

    Does this help?

    =IF(D2<>"vrijgegeven","geen reminder",IF(AND(OR($D2="vrijgegeven",AND(COUNTIFS($A$2:$A$18,$A2)>1,COUNTIFS($A$2:$A$18,$A2,$D$2:$D$18,"vrijgegeven"))),COUNTIFS($A$2:$A$18,$A2,$B$2:$B$18,">"&DATE(2015,12,1))),"geen reminder","reminder"))
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  7. #7
    Registered User
    Join Date
    01-08-2012
    Location
    Zwijndrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    20

    Re: 'If' conditions on multiple criteria and rows

    Quote Originally Posted by AliGW View Post
    Does this help?

    =IF(D2<>"vrijgegeven","geen reminder",IF(AND(OR($D2="vrijgegeven",AND(COUNTIFS($A$2:$A$18,$A2)>1,COUNTIFS($A$2:$A$18,$A2,$D$2:$D$18,"vrijgegeven"))),COUNTIFS($A$2:$A$18,$A2,$B$2:$B$18,">"&DATE(2015,12,1))),"geen reminder","reminder"))
    AliGW,

    Thanks! This will help me a lot!
    The only thing that still has to be done, is that the condition for column C has to be between 1-1-2015 en 31-12-2015. (I wrote this as: =IF(AND($C2<(TODAY()-1813);$C2>(TODAY()-2177);ISNUMBER($C2));"TRUE";"-") because over e.g. three month other company's will receive a reminder.

    I hope you can fix this in the formula!

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,045

    Re: 'If' conditions on multiple criteria and rows

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

    Let us know if you have any questions.

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,659

    Re: 'If' conditions on multiple criteria and rows

    Alternative formula:
    Please Login or Register  to view this content.
    I interpret in brief way , 3 criterias to returns "reminder":

    D2="vrijgegeven"

    YEAR(C2)=2015

    COUNTIF($A$2:$A$18,A2)=COUNTIFS($A$2:$A$18,A2,$B$2:$B$18,"<"&DATE(2015,12,1))
    (Count of specific company = count of that company with date <1/12/2015)
    Last edited by bebo021999; 12-29-2020 at 12:46 AM.
    Quang PT

  10. #10
    Registered User
    Join Date
    01-08-2012
    Location
    Zwijndrecht, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    20

    Thumbs up Re: 'If' conditions on multiple criteria and rows

    JeteMc & bebo021999,

    thanks for your help. It works!
    Now I'm aible to check more then 6000 cases in one time!
    Both solutions do the job well.

    I appreciate your professional help for an Excel-amateur like me.
    (of course also thanks to Pete-UK en AliGW for their help earlier on)

    VBAStarter

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,234

    Re: 'If' conditions on multiple criteria and rows

    Pleasure. Thanks for the rep.

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,045

    Re: 'If' conditions on multiple criteria and rows

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Populate rows with cells that first meet two conditions criteria
    By systems32 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-03-2020, 03:06 AM
  2. Multiple Criteria and Conditions for Commission AND IF Help
    By fabernaldez in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-19-2018, 06:53 AM
  3. [SOLVED] If statement multiple conditions and criteria
    By PowerZ in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-21-2016, 11:18 AM
  4. [SOLVED] MS SQL Query conditions, multiple criteria within criteria
    By Speshul in forum Access Tables & Databases
    Replies: 1
    Last Post: 07-29-2014, 12:16 PM
  5. 3 multiple conditions with multiple criteria formula help
    By rmnk101190 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-29-2013, 04:37 PM
  6. Criteria With Multiple Conditions
    By patrickargao in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-04-2012, 11:31 PM
  7. How to satisfy multiple conditions using multiple criteria
    By binkatron5000 in forum Excel General
    Replies: 13
    Last Post: 10-16-2009, 06:55 PM

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