+ Reply to Thread
Results 1 to 17 of 17

How to give result in a cell based on monthly/yearly conditions?

  1. #1
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    777

    How to give result in a cell based on monthly/yearly conditions?

    Hi all,

    Hope all are well.

    Need a help in formulae in sheet PR Availability under column C.

    The existing formula needs to be added with one more condition such that if Name in Column B in sheet PR Availability appears in column I of sheet PR Records more than 20 times in a month in a year, then show Not Available

    Date to be considered as in column O.

    Can someone please help
    Attached Files Attached Files
    Last edited by rizwanulhasan; 02-28-2024 at 07:26 AM.

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: How to give result in a cell based on monthly/yearly conditions?

    where is the date in the PR Availability sheet to use - i'm assuming the PR Records will be much longer and have various dates in
    and which column of dates - column K ???

    you should be able to add
    =COUNTIFS('PR Records'!$I$3:$I$11,B4,'PR Records'!$K$3:$K$11,">="&DATE(YEAR($F$1),MONTH($F$1),DAY(1)),'PR Records'!$K$3:$K$11,"<="&EOMONTH(F1,1))
    where i have added F1 as a date for the report to use
    that will count the instances of that name in the month
    then to if you want to exclude over 20 - just add >20
    =COUNTIFS('PR Records'!$I$3:$I$11,B4,'PR Records'!$K$3:$K$11,">="&DATE(YEAR($F$1),MONTH($F$1),DAY(1)),'PR Records'!$K$3:$K$11,"<="&EOMONTH(F1,1))>20

    but no date to tell what month to use
    Attached Files Attached Files
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    777

    Re: How to give result in a cell based on monthly/yearly conditions?

    @etaf

    Thanks for the response.

    As mentioned in 1st post, dates are to be considered from column O in sheet "PR Records"

    Data is to be fetched from sheet "PR Records" and result in column C of sheet "PR Availability"

  4. #4
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: How to give result in a cell based on monthly/yearly conditions?

    As mentioned in 1st post, dates are to be considered from column O in sheet "PR Records"
    missed that
    so
    =COUNTIFS('PR Records'!$I$3:$I$11,B4,'PR Records'!$K$3:$K$11,">="&DATE(YEAR($F$1),MONTH($F$1),DAY(1)),'PR Records'!$K$3:$K$11,"<="&EOMONTH($F$1,1))>20
    becomes
    with O and can change the rows to however many needed
    =COUNTIFS('PR Records'!$I$3:$I$100,B4,'PR Records'!$O$3:$O$100,">="&DATE(YEAR($F$1),MONTH($F$1),DAY(1)),'PR Records'!$O$3:$O$100,"<="&EOMONTH($F$1,1))>20
    Add to the OR - for status needed -

    But where is the date criteria to use in "PR Availability" - i have used F1 in the attached as the date of the report and that is then the month and year for the criteria
    see results in column K
    Attached Files Attached Files
    Last edited by etaf; 02-28-2024 at 06:50 AM.

  5. #5
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    777

    Re: How to give result in a cell based on monthly/yearly conditions?

    Date is to be used from sheet PR Records.

    Sorry for the confusion, let me explain in detail.

    Column C in sheet "PR Availability" should show as Not Available if below conditions are met, else Available

    1. if D4 (PR Availability) = Do Not Disturb

    2. If E4 (PR Availability) = Out of Office

    3. If name under column B in sheet "PR Availability" appears under column I in sheet "PR Records" and has status as Pending more than 1 in count under column N (PR Availability)

    4. If name under column B in sheet "PR Availability" appears under column I in sheet "PR Records" and has status as Completed more than 1 in count under column N (PR Availability) in a single day where the date is considered from column P (hidden)

    All the above conditions are existing in current formula i.e. below one

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


    Now in addition to above conditions, below is also required

    5. If name under Column B in sheet "PR Availability" appears in column I in sheet "PR Records" more than 20 times in a month in a year, for example (Feb 2024) where date to be considered is from column O or P (hidden).

    Hope i was able to explain.
    Last edited by rizwanulhasan; 02-28-2024 at 07:06 AM.

  6. #6
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: How to give result in a cell based on monthly/yearly conditions?

    yep, thanks - thats would i thought you wanted - i was just struggling with how to count the dates

    if you have months say for 2023 and 2024 year in pr records
    and say only JAN 23 had more than 20 entries for one name

    so the O is hidden in the "PR availability" sheet and thats what is looked up in sheet "PR records" for that month and year

    I4 in PR availability is blank - what happens then

    sorry i'm not getting it for you .........

    =COUNTIFS('PR Records'!$I$3:$I$100,B4,'PR Records'!$O$3:$O$100,">="&DATE(YEAR($I4),MONTH($I4),DAY(1)),'PR Records'!$O$3:$O$100,"<="&EOMONTH($I4,1))>20
    Add to the OR - for status needed -

    =IF(OR(COUNTIFS('PR Records'!$I$3:$I$127,B4,'PR Records'!$O$3:$O$127,">="&DATE(YEAR($I4),MONTH($I4),DAY(1)),'PR Records'!$O$3:$O$127,"<="&EOMONTH($I4,1))>20,D4="Do Not Disturb", E4="Out Of Office",COUNTIFS(Table5[Reviewer],'PR Availability'!B4,Table5[Review Status],"Pending")>1,COUNTIFS(Table5[Reviewer],'PR Availability'!B4,Table5[Test Column],TODAY(),Table5[Review Status],"Completed">1)),"Not Available","Available")

    but your sample does not have a name for 20 records - so we can see that working with the sample data

    i have unhidden columns but tried to add - no idea what is going on in the spreadsheet - and i do NOT run any macros on samples

    as i say sorry , i'm not following - hopefully someone will be along and see what you want exactly

  7. #7
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: How to give result in a cell based on monthly/yearly conditions?

    You could also use the formula bellow.

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


    By the way, conditional formatting can be restricted to the named table area, as new rows are added the CF will follow.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    777

    Re: How to give result in a cell based on monthly/yearly conditions?

    @DJunqueira

    Thanks for the response.

    2 issues noted.

    1. For testing purpose, i replaced 20 with 4 such that if name NM appears more than 4 times in Feb 24, then it should show Not Available. Although NM is present only once and that too in Jan' 24, yet cell C4 in sheet "PR Availability" shows as Not Available

    2. Point 4 in post # 5 doesn't work.

    Can you please check

  9. #9
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    777

    Re: How to give result in a cell based on monthly/yearly conditions?

    Perhaps i need to be more clear on point 5 in post # 5.

    5. If name under Column B in sheet "PR Availability" appears in column I in sheet "PR Records" more than 20 times in current month and current year, for example (Feb 2024) where date to be considered is from column O or P (hidden).

    Apologies for the miss

  10. #10
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: How to give result in a cell based on monthly/yearly conditions?

    OH Ok, Current month - based on todays date
    so for my formula
    =IF(OR(COUNTIFS('PR Records'!$I$3:$I$127,B4,'PR Records'!$O$3:$O$127,">="&DATE(YEAR(today()),MONTH(today()),DAY(1)),'PR Records'!$O$3:$O$127,"<="&EOMONTH(today(),1))>20,D4="Do Not Disturb", E4="Out Of Office",COUNTIFS(Table5[Reviewer],'PR Availability'!B4,Table5[Review Status],"Pending")>1,COUNTIFS(Table5[Reviewer],'PR Availability'!B4,Table5[Test Column],TODAY(),Table5[Review Status],"Completed">1)),"Not Available","Available")

    should work - note if you open the spreadsheet on March 1st or any day upto march the 31st - it will look for march 24 in column O in Pr records

    I also wasnt sure of the
    where date to be considered is from column O or P (hidden).
    which is it O or P or do you need to count BOTH columns
    then just add the countifs with P as the criteria columns in the OR

    I do not like using full column references - as they are just over 1 million rows

  11. #11
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    777

    Re: How to give result in a cell based on monthly/yearly conditions?

    Column P to be used

    All perfect except that point point 4 in post # 5 doesn't work.

  12. #12
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: How to give result in a cell based on monthly/yearly conditions?

    4. If name under column B in sheet "PR Availability" appears under column I in sheet "PR Records" and has status as Completed more than 1 in count under column N (PR Availability) in a single day where the date is considered from column P (hidden)

    ok, so a single day in the current month, so today()
    although i guess it does not matter

    can a helper column go into the PR records sheet
    i would add a simple count there

    =COUNTIFS($I$3:$I$100,I3,$O$3:$O$100,O3)

    as its anyday , then trying to see how you would use duplicate entries for Name and Date in the main formula - to isolate every day in a month


    then you can simple add an OR
    if helper column > 1

  13. #13
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    777

    Re: How to give result in a cell based on monthly/yearly conditions?

    Point 4 actually works fine with the formula that was existing i.e. below one

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


    However, it doesn't work when i use formula in post # 10.

    In actual, sheet PR Records has several macros. So addition of helper column will affect the macros

  14. #14
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: How to give result in a cell based on monthly/yearly conditions?

    ok
    ORGINAL
    =IF(
    OR(
    D4="Do Not Disturb",
    E4="Out Of Office",
    COUNTIFS(Table5[Reviewer],'PR Availability'!B4,Table5[Review Status],"Pending")>1,
    COUNTIFS(Table5[Reviewer],'PR Availability'!B4,Table5[Test Column],TODAY(),Table5[Review Status],"Completed">1)),

    "Not Available","Available")


    NEW
    =IF(
    OR(
    COUNTIFS('PR Records'!$I$3:$I$127,B4,'PR Records'!$O$3:$O$127,">="&DATE(YEAR(today()),MONTH(today()),DAY(1)),'PR Records'!$O$3:$O$127,"<="&EOMONTH(today(),1))>20,

    D4="Do Not Disturb",
    E4="Out Of Office",
    COUNTIFS(Table5[Reviewer],'PR Availability'!B4,Table5[Review Status],"Pending")>1,
    COUNTIFS(Table5[Reviewer],'PR Availability'!B4,Table5[Test Column],TODAY(),Table5[Review Status],"Completed">1)) ,
    "Not Available","Available")

    Apart from the extra condition added - the OR is the same so should still work for point 4 if it worked before

  15. #15
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    777

    Re: How to give result in a cell based on monthly/yearly conditions?

    Its perfect now. Just a change of symbol. My apologies for the trouble.

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


    Thanks a bunch.
    Last edited by rizwanulhasan; 02-29-2024 at 12:00 AM.

  16. #16
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,751

    Re: How to give result in a cell based on monthly/yearly conditions?

    you are welcome, no trouble - i did not see the missing )

  17. #17
    Forum Expert
    Join Date
    10-19-2021
    Location
    Brazil
    MS-Off Ver
    Office 365 V2401 w/ Win10 Home 64 Bit
    Posts
    2,014

    Re: How to give result in a cell based on monthly/yearly conditions?

    Tks for the feedback, glad to help.

+ 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] Charting to Give Yearly Total instead of Monthly
    By thematrix05 in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 12-04-2022, 04:26 PM
  2. Pro rate a monthly based cost into yearly columns
    By bladesman in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-12-2016, 06:02 PM
  3. Monthly, Bi-monthly, Quarterly, Yearly Report Tracking Help
    By eugene_lys in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-26-2014, 11:08 PM
  4. Daily Sales Target based on Yearly and Monthly
    By nishikanth in forum Excel General
    Replies: 2
    Last Post: 01-07-2014, 12:15 PM
  5. Replies: 1
    Last Post: 03-08-2013, 04:18 PM
  6. Replies: 5
    Last Post: 03-07-2013, 11:38 AM
  7. Replies: 3
    Last Post: 02-12-2011, 12:10 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