+ Reply to Thread
Results 1 to 10 of 10

Need a Formula for Determining starting and Ending Values year wise.

  1. #1
    Registered User
    Join Date
    01-29-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    22

    Need a Formula for Determining starting and Ending Values year wise.

    Hi,

    I have a data in excel sheet consisting of Day wise data for two companies A & B from 2016 to 2021.

    Need the starting value (first day of the year) of each year. If the starting value of year consist of "0" or "NA", the value should be the next day desired value.

    Need the Ending value (Last day of the year)of each year. If the Ending value of year consist of "0" or "NA", the value should be the Before day desired value.

    I have Attached the sheet with the data and the required format.
    excel1.PNG

    If you have any queries please let me know.

    Thanks.
    Attached Files Attached Files
    Last edited by click2chaitu; 07-20-2021 at 05:25 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Need a Formula for Determining starting and Ending Values year wise.

    The dates for both A and B ranges being the same in col A, the starting year is the same for both? What is the correlation between values in ranges A and B and the dates? Perhaps manually add some desired results?
    Starting days of each year are returned by
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    pulled down

  3. #3
    Registered User
    Join Date
    01-29-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    22

    Re: Need a Formula for Determining starting and Ending Values year wise.

    Hi Pepe,

    Thanks for the reply.

    Sorry, i have reformatted the required tables and uploaded the sheet and posted the image, sorry for the mistake.
    can you again check once the sheet.

    Thanks.
    Last edited by click2chaitu; 07-20-2021 at 05:28 AM.

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Need a Formula for Determining starting and Ending Values year wise.

    You can use this array* formula in cell F2:

    =VLOOKUP(MIN(IF((YEAR($A$2:$A$1365)=$E2)*(B$2:B$1365>0)*(ISNUMBER(B$2:B$1365)),$A$2:$A$1365)),$A:B,COLUMNS($A:B),0)

    *Note that an array formula needs to be confirmed using the key combination Ctrl-Shift-Enter, rather than the usual Enter.

    Copy into G2, then copy the two formulae down.

    A similar array* formula for J2:

    =VLOOKUP(MAX(IF((YEAR($A$2:$A$1365)=$I2)*(B$2:B$1365>0)*(ISNUMBER(B$2:B$1365)),$A$2:$A$1365)),$A:B,COLUMNS($A:B),0)

    (changes is red). Copy into K2, then copy both formulae down as required.

    Hope this helps.

    Pete

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Need a Formula for Determining starting and Ending Values year wise.

    Like this?
    My request was that YOU add some expected results manually to be sure.
    Anyway have a look at the attached
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-29-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    22

    Re: Need a Formula for Determining starting and Ending Values year wise.

    Hi Pete,

    Thanks for the solution. That helped me a lot.

    Thanks.

  7. #7
    Registered User
    Join Date
    01-29-2020
    Location
    India
    MS-Off Ver
    2019
    Posts
    22

    Re: Need a Formula for Determining starting and Ending Values year wise.

    Hi Pete_UK,

    Thanks for the solution. That helped me a lot.

    Thanks.

  8. #8
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,586

    Re: Need a Formula for Determining starting and Ending Values year wise.

    Pl see file
    In F2 copied across
    Please Login or Register  to view this content.
    In F2 copied across
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 07-20-2021 at 05:43 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Need a Formula for Determining starting and Ending Values year wise.

    Quote Originally Posted by click2chaitu View Post
    ... Thanks for the solution...
    You're welcome - thanks for the rep.

    If that takes care of your original question, please take a moment to select Thread Tools from the menu above and to the right of your first post in this thread, and mark the thread as SOLVED.

    Pete

  10. #10
    Forum Expert
    Join Date
    01-05-2013
    Location
    Singapore
    MS-Off Ver
    H&B2016 & H&B2021
    Posts
    3,057

    Re: Need a Formula for Determining starting and Ending Values year wise.

    Cell F2
    Please Login or Register  to view this content.
    Cell J2
    Please Login or Register  to view this content.

+ 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: 2
    Last Post: 01-22-2019, 03:15 AM
  2. Replies: 13
    Last Post: 04-20-2017, 02:16 PM
  3. how to sum up the cell values according to year wise
    By ramminani in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-24-2015, 12:55 AM
  4. [SOLVED] Formula to count entries as per month, year and submission wise
    By hanidean in forum Excel Formulas & Functions
    Replies: 16
    Last Post: 05-26-2013, 11:52 PM
  5. [SOLVED] how to get the max,min,average values months wise from 1 year data
    By sathiyamoorthy in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-19-2013, 01:43 AM
  6. [SOLVED] How to find Starting value and Ending Value of the product
    By svenkata in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-27-2012, 02:27 PM
  7. Replies: 6
    Last Post: 10-11-2011, 06:40 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