+ Reply to Thread
Results 1 to 29 of 29

Matching dates and % values

  1. #1
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Matching dates and % values

    I need help writing a formula that can scan down the dates in column A and the %'s in column B and return the word "Yes" if a % value > then 3% occurs in the first day of data.

    ie- if a value of 3% or greater occurs in column B on 3/9/11 then return the word Yes.
    Attached Files Attached Files
    Last edited by rhudgins; 06-13-2011 at 12:31 PM. Reason: If I don't mark it Solved, who will

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,717

    Re: Matching dates and % values

    In column C

    =IF(B2>0.03,"YES","")

    Copy down

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    That formula does not take into consideration the dates in Column A...

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Matching dates and % values

    Try this

    =IF(AND(INT(A2)=INT(MIN($A:$A)),B2>3%),"Yes","")
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    That formula does not work. That formula appears to be checking if B3>3% which is not what I am looking for. The formula needs to be able to scan all of the days on 3/9/11(because 3/9/11 is the first set of days in the data set) and return "Yes" if there is a value that is greater then 3% that occurs on 3/9/11

  6. #6
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,717

    Re: Matching dates and % values

    Since you only showed us one day, what do you want to happen to the rest of the days? I am very confused now. Perhaps you could show an example with more dates and data of what you want the end result to look like. It doesn't have to be a big file. Several lines with different dates and data and the result you want for each of those lines.

    Alan

  7. #7
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    I made the following adjustment which now looks down all of column D. I am having one problem though. The date in A2 includes HH:MM:SS. How can i change the formula to only look at the mm/dd/yyyy part of the cell?


    =IF(AND(INT(A2)=INT(MIN($A:$A)),$B:$B>3%),"Yes","")

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Matching dates and % values

    The mm/dd/yy part is the integer part so INT(cell) should work for you.

    Try this formula
    =IF(SUMPRODUCT(--(INT($A$2:$A$1483)=INT(MIN($A$2:$A$1483))),--($B$2:$B$1483>3%))>0,"Yes","")
    Does that work for you?

  9. #9
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    Yes sir. That works perfectly. Thanks!

  10. #10
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    I have two adjustments I am trying to make to the formula that you helped me out with.

    Is there a way to change the INT to check for the first two available dates in column A?

    Assuming this formula is in cell D1. If I drag the formula down to cell D2, D3, D4 ect. is there a way to change the formula to shift the ranges 25 columns to the right everytime the formula is moved down a cell?

  11. #11
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Matching dates and % values

    First 2 available dates
    Easiest if dates are sequential,
    =IF(SUMPRODUCT(--(INT($A$2:$A$1483)<=INT(MIN($A$2:$A$1483)+1)),--($B$2:$B$1483>3%))>0,"Yes","")
    I'll have to think on the second question.

  12. #12
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    Thank you for your help.

  13. #13
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    Any ideas?

  14. #14
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Matching dates and % values

    Using Chemists' formula and assuming you are using the same column A, but only jumping 25 columns at a time for the delta column... try:

    Please Login or Register  to view this content.
    adjusting the $ZZ$1483 to whatever the last column in your database happens to be.

    If you want to jump 25 Date and Delta columns together, then

    Please Login or Register  to view this content.
    Last edited by NBVC; 06-09-2011 at 12:25 PM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  15. #15
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    Thanks that helps alot. I tried to change the value to < -2% but the formula will not work. Any ideas what is wrong?
    Please Login or Register  to view this content.

  16. #16
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Matching dates and % values

    Why did you switch the >0 operand to <0 at the end of the logical_test of the IF() function?

  17. #17
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    Thats why it is not working. Thanks for the catch

  18. #18
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Matching dates and % values

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

  19. #19
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    Is there a way to change this formula to scan the first 2 Workdays instead of just 2 days?


    Please Login or Register  to view this content.

  20. #20
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Matching dates and % values

    I think this is going to get too complex... is there any way you can remove the rows with weekend dates? then you can possibly use:

    Please Login or Register  to view this content.

  21. #21
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    There are no weekend dates in my data set but the formula does not work. Any ideas why? This is my modified formula with different ranges.

    Please Login or Register  to view this content.

  22. #22
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Matching dates and % values

    In what way doesn't it work?

    Maybe a sample workbook showing it not working might help?

  23. #23
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    Here is the sample. The formula is in AF20. The data in column AJ contains a value less then <-2% and the formula returns "Yes" correctly. The data in column AV does not have a value <-2% in the first two days but the formula still says 'Yes". which is incorrect.
    Attached Files Attached Files

  24. #24
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Matching dates and % values

    I have to look at this over the weekend.... signing off for now....

    So your data already doesn't include weekends, so you want to be able to skip to next available day after the first date it encounters, even though it might not be the next actual date on the calendar, correct?

  25. #25
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    Correct, I would like it to skip to the next working date on the calander.

  26. #26
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Matching dates and % values

    In column AI you have dates below all the April dates that fall in March. Is that right? Hopefully, that is wrong and they should be chronologically listed dates instead.

    If so then try:

    Please Login or Register  to view this content.
    CSE confirmed and copied down.

    If not..we have another problem....

  27. #27
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    Thanks thsi formula works. You were right, the data should have been listed in chronological order. How can I change this formula to change to the first day only instead of the first two days?

  28. #28
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Matching dates and % values

    So how many times are you going to change the condition in this thread?

    Isn't that what ChemistB started you off with?

  29. #29
    Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2016
    Posts
    747

    Re: Matching dates and % values

    Yes you are correct. Thank you for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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