+ Reply to Thread
Results 1 to 13 of 13

Count the number of wet days following a dry day..

  1. #1
    Registered User
    Join Date
    05-22-2012
    Location
    South Korea
    MS-Off Ver
    Excel 2007
    Posts
    6

    Count the number of wet days following a dry day..

    Hi!

    Can somebody please help to determine which formula works best for my spreadsheet?

    Okay so here's an example of what my data set looks like.

    1111.JPG

    I want to create a formula which could count the number of wet days following a dry day.

    So, in this case, the answer should be 3, only counting A4, A7 and A14.

    Or if in case I would like to count the number of wet days following a wet day, the answer should also be 3.
    In this case, the A5, A8 and A9 cells should only be counted.

    I hope someone can help me on this one.. It's too confusing and I'm not an Excel expert too.

    Thanks!

  2. #2
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: Count the number of wet days following a dry day..

    Your logic isn't clear, how the counting of wet and dry days is to be done. Can u upload a workbook with sample data and briefly explain how the output would look like from your input data?
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  3. #3
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Count the number of wet days following a dry day..

    Hello and welcome to the forum
    Assuming your data is in A1 to A15 then for wet days followed by dry days try below
    =SUMPRODUCT(--($A$2:$A$14=0)*($A$3:$A$15>0))

    for wet days follow by wet days try below
    =SUMPRODUCT(--($A$2:$A$14>0)*($A$3:$A$15>0))

    change the data ranges as per your actual data
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  4. #4
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Count the number of wet days following a dry day..

    Like this? Random numbers for the purpose of testing, hit F9 to renew. Three formulas, the one in the middle is array, have to be entered with Ctrl + Shift + Enter. Note that the ranges are offset one cell.
    Attached Files Attached Files
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  5. #5
    Registered User
    Join Date
    05-22-2012
    Location
    South Korea
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Count the number of wet days following a dry day..

    Quote Originally Posted by Jacc View Post
    Like this? Random numbers for the purpose of testing, hit F9 to renew. Three formulas, the one in the middle is array, have to be entered with Ctrl + Shift + Enter. Note that the ranges are offset one cell.
    The random numbers were so cool! I didn't know that Excel could do that!

    Anyway, I also know about that IF AND function.. However, I was actually hoping there's no need for me to create several columns for that~

    here's my file~^^
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    05-22-2012
    Location
    South Korea
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Count the number of wet days following a dry day..

    I've tried using your formulae but it seems like it's not quite working for me..

  7. #7
    Valued Forum Contributor
    Join Date
    09-01-2013
    Location
    Dallas, TX
    MS-Off Ver
    Excel 2010
    Posts
    324

    Re: Count the number of wet days following a dry day..

    Hello ayskriim,

    please see the attached sheet:
    Attached Files Attached Files


    Shelton A.
    If Helpful, Add Reputaion!

  8. #8
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Count the number of wet days following a dry day..

    for dry day followed by wet days
    in H4 copy paste below then hold control and shift together and then hit enter Drag up to first december
    =SUMPRODUCT(IFERROR(--(TEXT($B$3:$B$367,"MMM")=$G4)*($D$3:$D$366=0)*($D$4:$D$367>0),0))

    for wet days followed by wet days
    in H16 copy paste below then hold control and shift together and then hit enter Drag down
    =SUMPRODUCT(IFERROR(--(TEXT($B$3:$B$367,"MMM")=$G16)*($D$3:$D$366>0)*($D$4:$D$367>0),0))
    Attached Files Attached Files
    Last edited by hemesh; 05-16-2014 at 02:57 AM.

  9. #9
    Registered User
    Join Date
    05-22-2012
    Location
    South Korea
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Count the number of wet days following a dry day..

    Quote Originally Posted by playaller View Post
    Hello ayskriim,

    please see the attached sheet:
    I think it's almost right. I'm sorry if my excel file was a bit wrong.. I revised it..

    I was hoping that you can help me determine the count for every month.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-22-2012
    Location
    South Korea
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Count the number of wet days following a dry day..

    Quote Originally Posted by hemesh View Post
    in H4 copy paste below then hold control and shift together and then hit enter Drag up to first december
    =SUMPRODUCT(IFERROR(--(TEXT($B$3:$B$367,"MMM")=$G4)*($D$3:$D$367=0)*($D$4:$D$367>0),0))
    BRILLIANT!!!! Thanks a lot!!!!!!!^^

    The people here are so awesome!

    Thanks a lot for helping me~^^

  11. #11
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Count the number of wet days following a dry day..

    You are welcome and Thanks for the feedback !
    Check the file Which I have updated there I have removed the cell I took Extra in the formula.

  12. #12
    Registered User
    Join Date
    05-22-2012
    Location
    South Korea
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Count the number of wet days following a dry day..

    Quote Originally Posted by hemesh View Post
    You are welcome and Thanks for the feedback !
    My pleasure! that was brilliant! but if it's okay to ask one more thing, how can i count the number of wet days following a wet day?

  13. #13
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Count the number of wet days following a dry day..

    Quote Originally Posted by hemesh View Post
    for dry day followed by wet days
    in H4 copy paste below then hold control and shift together and then hit enter Drag up to first december
    =SUMPRODUCT(IFERROR(--(TEXT($B$3:$B$367,"MMM")=$G4)*($D$3:$D$366=0)*($D$4:$D$367>0),0))

    for wet days followed by wet days
    in H16 copy paste below then hold control and shift together and then hit enter Drag down
    =SUMPRODUCT(IFERROR(--(TEXT($B$3:$B$367,"MMM")=$G16)*($D$3:$D$366>0)*($D$4:$D$367>0),0))
    check above also file is attached in Post #8

+ 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. Count number of days between a period
    By amurray2307 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-20-2013, 05:40 AM
  2. Help on count the number of days in between dates and then average number of days
    By Barbara Excel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-30-2013, 12:13 PM
  3. [SOLVED] Count Number of Days
    By nancyching1711 in forum Excel General
    Replies: 12
    Last Post: 10-06-2012, 08:08 AM
  4. Count The Number of days
    By wish2excel in forum Excel General
    Replies: 12
    Last Post: 10-11-2010, 08:26 AM
  5. Count number of days
    By TrainerJ in forum Excel General
    Replies: 4
    Last Post: 02-15-2010, 02:57 PM

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