+ Reply to Thread
Results 1 to 11 of 11

count if with two variables

  1. #1
    Registered User
    Join Date
    11-13-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    42

    count if with two variables

    Ok looking for guidance on this formula.

    Cell O7 is the date the case was closed but Cell P7 is the date the case was pulled aka I didnt close it since it was pulled from me and no longer an active case.

    My question is what tweek needs to be made to the below mentioned formula to show the result of Closed vs Pulled.

    I'd like to have the cell show a result of the days open if no data is in cell O7 or P7 but if there is a date in O7 have it show CLOSED and if there is a date in P7 have it show INACTIVE.

    What would be the best formula?

    Currently this is the formula being used.
    Please Login or Register  to view this content.
    Original Post can be found here

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: count if with two variables

    You need to post a workbook. Your original thread has data in A1, E2:H2. Then you posted a formula referencing cells B1, I3, O3 & P3.
    Now, the current post has data in H7, O7, P7 and X3. Very confusing.
    Ben Van Johnson

  3. #3
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: count if with two variables

    You have attach sample file, its more helpful for both.
    When you are going with two dates, close date always grater than other date.
    As per my assuming try
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  4. #4
    Registered User
    Join Date
    11-13-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: count if with two variables

    Ok please see attached sample file.

    Row 5 is the row that should be showing a case status of inactive in cell C5.

    When a case has been pulled from me or is no longer in active status I want to have it displace INACTIVE in the cell C5 based on their being a date in Cell P5

    However when a case has been marked as closed there will be a date in Cell O5 and P5 will be blank

    Hopefully this makes sense.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-13-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: count if with two variables

    Maybe this will help clear up some confusion.

    I need to write an "if" statement in Excel based on text in two different cells.

    If O5 has a date then the text in Cell C5 will display CLOSED
    If P5 has a date then the text in Cell C5 will display INACTIVE
    If neither O5 or P5 has a date in it then cell C5 will display a total day counter based on a calculation of today's date and the date that is entered into cell H5

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: count if with two variables

    I think this covers what you want...
    =IF(AND(O5<>"",P5<>""),H5,IF(AND(O5<>"",P5=""),"CLOSED","INACTIVE"))
    though I am not sure what you mean here...
    C5 will display a total day counter based on a calculation of today's date and the date that is entered into cell H5
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  7. #7
    Registered User
    Join Date
    11-13-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: count if with two variables

    Sambo Kid,

    I need to display a counter in cell C5. So if I enter a date that I got the case in Cell H5 and that date was 08/31/2018 and todays date is 09/02/2018 then the counter would display 2 days.

    See the original formula above.

  8. #8
    Registered User
    Join Date
    11-13-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: count if with two variables

    Quote Originally Posted by Sambo kid View Post
    I think this covers what you want...
    =IF(AND(O5<>"",P5<>""),H5,IF(AND(O5<>"",P5=""),"CLOSED","INACTIVE"))
    though I am not sure what you mean here...
    Here is the original formula that I have been using.
    Please Login or Register  to view this content.

  9. #9
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,613

    Re: count if with two variables

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    11-13-2012
    Location
    WA
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: count if with two variables

    This worked perfect. Thank you very much!

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

    Re: count if with two variables

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.
    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.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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] Count 2 different variables from different columns?
    By willbassyeah in forum Excel General
    Replies: 8
    Last Post: 09-19-2012, 12:09 PM
  2. count with two variables
    By nigelog in forum Excel General
    Replies: 6
    Last Post: 10-12-2010, 11:05 AM
  3. Count functions with variables
    By JohnathanC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-18-2010, 12:11 PM
  4. Multiple Variables Count
    By fsoares22 in forum Excel General
    Replies: 4
    Last Post: 10-28-2009, 03:03 PM
  5. Count using 2 variables
    By LarryC in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-09-2008, 09:12 AM
  6. [SOLVED] How do I count to different variables in excel
    By bpeltzer in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 06:05 PM
  7. How do I count to different variables in excel
    By bpeltzer in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 06:05 AM
  8. [SOLVED] How do I count to different variables in excel
    By Jonhart75 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 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