+ Reply to Thread
Results 1 to 9 of 9

Locking in a particular year

  1. #1
    Forum Contributor
    Join Date
    08-18-2021
    Location
    Pennsylvania
    MS-Off Ver
    Offic 365
    Posts
    110

    Locking in a particular year

    Can someone show me how to write this formula so that it looks at a specific year to obtain a total?
    =SUMPRODUCT(C$7:C$200,--(TEXT(A$7:A$200,"MMM")=A$207)) *A207 contains the formula =TEXT(TODAY(),"mmm")

    The formula shown does provide the information needed for the current year, however I have the spread sheet set up with multiple year columns. Each separate years column will have the dates for that particular years expenses.

    The formula shown needs to provide the current month data only for the current year. Currently every entry in 2022 should show in the total column cell for 2022 , and not show entry's that have a year of 2023 for example.

    I have copies of all columns moving left to right for year 2022's thru 2030 and I need the totals to only show for the year and column the data is recorded. I can't simply use the NOW() or (TODAY() function as it will change the totals in every year's column to the current year as the years go by.

    Thanks for any help offered!
    Fred

  2. #2
    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,990

    Re: Locking in a particular year

    Try this:

    =SUMPRODUCT(C$7:C$200,--(TEXT(A$7:A$200,"MMM YYYY")=A$207))

    Change A207 to: =TEXT(TODAY(),"mmm yyyy")
    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.

  3. #3
    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,990

    Re: Locking in a particular year

    Alternatively, witout having to change A207:

    =SUMPRODUCT(C$7:C$200,--(TEXT(A$7:A$200,"MMM YYYY")=A$207)*(YEAR(A$7:A$200)=2022))

    Change year to suit.

    If neither solution works for you, provide a sample workbook (you should always do this if you want quick response, anyway).

  4. #4
    Forum Contributor
    Join Date
    08-18-2021
    Location
    Pennsylvania
    MS-Off Ver
    Offic 365
    Posts
    110

    Re: Locking in a particular year

    Your suggestion only works for the current year not subsequent years going forward.
    I've attached an example from my spreadsheet.

    My attachment refers to A207 which is the correct cell for my actual spread sheet NOT the correct cell though in my attachment , it should say A22.
    Last edited by Fred Houck; 11-02-2022 at 10:01 AM.

  5. #5
    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,990

    Re: Locking in a particular year

    A207 and E207 don't have formulae - where shall I find what I am supposed to be looking at?

    Maybe try this (another guess):

    =SUMPRODUCT(C$7:C$200,--(TEXT(A$7:A$200,"MMM YYYY")=A$207)*(YEAR(A$7:A$200)>=2022))

  6. #6
    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,990

    Re: Locking in a particular year

    Is this what you want???

    =SUMPRODUCT(G$7:G$15,--(MONTH(E$7:E$15)=MONTH(E$22))*(YEAR(E$7:E$15)>=YEAR(E$22)))

    The colour scheme in your workbook is not at all easy on the eyes - I would give serious consideration to changing it.

  7. #7
    Forum Contributor
    Join Date
    08-18-2021
    Location
    Pennsylvania
    MS-Off Ver
    Offic 365
    Posts
    110

    Re: Locking in a particular year

    Your formula worked for cell (C3) but not (A22) However I found a way to solve the problem by simply changing cell(A22) to (=A5). That cell is a drop down field to select a particular month and is setup to be the months for every specific year.

    Thanks for you're help This forum is a life savor for me. I try out to use it till I've exhausted every possible thing I could think of trying but failed.

  8. #8
    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,990

    Re: Locking in a particular year

    Glad to have helped.

    If that takes care of your original question, please choose Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, if you have not already done so, you may not be aware that you can thank those who have helped you by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  9. #9
    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
    28,216

    Re: Locking in a particular year

    Suggested changes:

    in B29

    =SUMIFS(C$7:C$15,A$7:A$15,">="&A29,A$7:A$15,"<="&EOMONTH(A29,0))

    Copy down

    Copy to F29 (and other years).

    Which figures are wrong ???
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

+ 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. Replies: 0
    Last Post: 03-29-2022, 04:59 PM
  2. locking specific cells ends up locking the whole sheet and I dont know why
    By jitterbug888 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 06-10-2019, 12:14 AM
  3. [SOLVED] Locking Cells without locking worksheet
    By navialivad in forum Excel General
    Replies: 5
    Last Post: 11-24-2014, 12:44 PM
  4. Replies: 3
    Last Post: 09-04-2013, 10:49 AM
  5. Locking cell by year
    By btalty in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-04-2012, 05:11 PM
  6. Help with macro, automatical locking cells when excel is closed but only locking 1 sh
    By snoopy1461 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-21-2011, 11:29 AM
  7. Replies: 1
    Last Post: 07-21-2006, 11: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