+ Reply to Thread
Results 1 to 26 of 26

want to add additional condition to If and countifs function

  1. #1
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    want to add additional condition to If and countifs function

    Hello experts,
    I am trying to match 2 rows with the help of a formula. The problem is if the difference in amount is more or less than 1/- it shows a mismatch. By editing the formula, I want it to show Matched. Also, I am trying to add one more if function within the formula to get 3 results - "Matched", "Books Not Entered" and "Not in Portal" as shown in sheet Matched Manually. Need your expertise to solve this.
    AS there are more than 6000 rows to match at a time, it takes a lot of time to match it manually. Hope to get it done in less than a minute with the help of a perfect formula.

    Query IF COUNTIFS.xlsx

    How do I change from VBA to Formulas...?
    Last edited by RAJESH SHAH; 12-01-2021 at 06:34 AM.

  2. #2
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,387

    Re: If and countifs function

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

    Why have you posted in the VBA section?
    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.

  3. #3
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,387

    Re: want to add additional condition to If and countifs function

    Thanks for the title change.

    Why did you post in the VBA section? Do you want a formula? If so, I will move your thread.

  4. #4
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: want to add additional condition to If and countifs function

    Please tell me how to change that, so that in future I can do it if I have posted it by mistake to some other section.

  5. #5
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,387

    Re: want to add additional condition to If and countifs function

    I have moved it - it is now in the correct section.

  6. #6
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: want to add additional condition to If and countifs function

    Sorry for the blunder and Thanks.

  7. #7
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: want to add additional condition to If and countifs function

    It would be helpful to give what you expect as your answers in the example

    Your current formula only says matched for the first unique combination of C and F. I am not seeing how it matches rows

    I think a little more explanation is needed, but I do think a formula will do the job, when we know what you want

  8. #8
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: want to add additional condition to If and countifs function

    I have entered the formula in the With Formula sheet in the Remarks column =IF(COUNTIFS(C$2:C2,C2,F$2:F2,F2)=1,"Matched","Mismatch"). There are multiple columns in the original data base. But the only values that match between the Portal and Books is the Tin Column. So I have shared only those columns. I know the formula is wrong that is why I need to correct it.

  9. #9
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: want to add additional condition to If and countifs function

    If the Tin number and Amounts are same as per Books and as per Portal then it is a match. The formula should accept the difference in amount by a margin of +1/- or -1/. If the above condition is not met then it is a mismatch. The additional IF formula will find whether it is Not in Portal or Books not entered which I want it add to the same formula.

  10. #10
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,735

    Re: want to add additional condition to If and countifs function

    My understanding:

    For a given "TIN" [column C], we need match "PORTAL" GST value with equivalent "BOOKS" GST values and find a match with absolute difference <= 1: this is Matched status.

    For non-match, determine whether missing item is from "Portal" or "Books".

    Too tricky for my brain !!
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  11. #11
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: want to add additional condition to If and countifs function

    Yes. Quite a mind teaser. But anything is possible in Excel.

  12. #12
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: want to add additional condition to If and countifs function

    For your reference, I am again uploading one workbook to show how I have matched manually the Portal with Books.
    Attachment 757599

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: want to add additional condition to If and countifs function

    I have not looked at your attachment at Post 12. Does this work??

    =IF(COUNTIFS($C$2:$C$19,C2,$F$2:$F$19,">="&F2-1,$F$2:$F$19,"<="&F2+1)>=2,"Matched",IF(B2="Books","Not in Portal","Books not Entered"))

    See file.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  14. #14
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: want to add additional condition to If and countifs function

    The attachment in post 12 is invalid

  15. #15
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: want to add additional condition to If and countifs function

    Glenn Kennedy. It is working correctly in the sample data. I have shared another worksheet where the rows are a match and your formula is showing mismatch. Please check this...Attachment 757604

  16. #16
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: want to add additional condition to If and countifs function

    Invalid ...??

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: want to add additional condition to If and countifs function

    I'm not a mind reader.... where is it incorrect??

  18. #18
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: want to add additional condition to If and countifs function

    Ignore my last post!!

  19. #19
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: want to add additional condition to If and countifs function

    I have shared it in the attachment

  20. #20
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: want to add additional condition to If and countifs function

    I'm no longer sure that I understand your requirement!!

  21. #21
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: want to add additional condition to If and countifs function

    Quote Originally Posted by Glenn Kennedy View Post
    I'm no longer sure that I understand your requirement!!
    It is okay. I will do it manually till I find a solution. Anyways you gave the correct formula for the original post. Thanks.

  22. #22
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: want to add additional condition to If and countifs function

    I am making some progress, so keep an eye on your thread. I have to leave shortly for a couple of hours.

  23. #23
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: want to add additional condition to If and countifs function

    Quote Originally Posted by Glenn Kennedy View Post
    I am making some progress, so keep an eye on your thread. I have to leave shortly for a couple of hours.
    Okies .I will

  24. #24
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,869

    Re: want to add additional condition to If and countifs function

    Selecting Attachment 757604 in post #15 results in the following: "Invalid Attachment specified. If you followed a valid link, please notify the administrator".
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  25. #25
    Forum Contributor
    Join Date
    11-25-2021
    Location
    INDIA
    MS-Off Ver
    2007
    Posts
    2,171

    Re: want to add additional condition to If and countifs function

    Glenn Kennedy. This is to inform you that today the above query finally has been solved.
    solution:
    Please Login or Register  to view this content.
    Last edited by AliGW; 05-27-2022 at 05:12 AM. Reason: Code tags corrected.

  26. #26
    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. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,387

    Re: want to add additional condition to If and countifs function

    Please share the solution here and then mark the thread as solved. Thanks.

    EDIT: Thanks for sharing the solution.
    Last edited by AliGW; 05-27-2022 at 05:11 AM.

+ 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. Excel function: countifs with nested OR function and wildcards
    By Franfv in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-18-2020, 03:57 AM
  2. CountIFs function
    By xdah in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-06-2019, 09:19 PM
  3. adding a Frequency function to a CountIFS function
    By Plucky_ in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-12-2017, 08:13 PM
  4. Countifs + OR function
    By Espenjk in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-11-2016, 07:52 PM
  5. COUNTIF/COUNTIFS function + nested user-defined function
    By shamjamali in forum Excel General
    Replies: 1
    Last Post: 05-12-2015, 09:12 PM
  6. Use COUNTIFS function on results of DATEVALUE function?
    By Si902 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-16-2015, 08:13 PM
  7. Replies: 0
    Last Post: 12-16-2011, 09:01 AM

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