+ Reply to Thread
Results 1 to 16 of 16

Record with year of working

  1. #1
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    140

    Record with year of working

    Hi,
    I have a file where in F column the data have mentioned the year of working. I need the data mentioned in K and L column. K column result based the data mentioned from F column and L column data will take from G column. File attached for your reference. Thanks.
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2016
    Posts
    897

    Re: Record with year of working

    Hi there,

    I have added a couple of 'helper columns' to breakdown the months and years.
    From there we can use the 'Countifs' and 'Averageifs' formulas.

    Hope this helps.
    Attached Files Attached Files
    Last edited by ORoos; 10-25-2022 at 05:43 AM. Reason: Corrected Average from col H to G
    If your Question is answered; please mark it SOLVED. If you are happy with a member's solution, say 'Thanks' and click the 'Star' to Add Reputation.

  3. #3
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Record with year of working

    Since I assume employees can't fall into two categories, I've assume that the month ranges are m<6, 6<=m<12, 12<=m<24, 24<=m. Then:

    Please Login or Register  to view this content.
    See attached.

    WBD
    Attached Files Attached Files
    Office 365 on Windows 11, looking for rep!

  4. #4
    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,206

    Re: Record with year of working

    Another

    in K2

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


    in K3

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


    in L2

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


    similar for others
    Attached Files Attached Files
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2016
    Posts
    897

    Re: Record with year of working

    Hi WBD,
    Good formula. Just one point: there are variations of Year vs Years and Month vs Months. Does your formula account for this?

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Record with year of working

    An alternative, using FILTERXML. Results are different from WBD

    I used <6mo, >-6mo and <12mo,>=1Yr and <2Yr, >=2Yr
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  7. #7
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Record with year of working

    Quote Originally Posted by ORoos View Post
    there are variations of Year vs Years and Month vs Months. Does your formula account for this?
    Good catch! Changing "Years" to "Year" should do it

    Please Login or Register  to view this content.
    WBD
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    140

    Re: Record with year of working

    Dear All,
    Thanks for your effort to solve my issue. Actual i had attached the sheet where i have highlighted the column in yellow and attached sheet again.
    I need a formula accordingly.
    Attached Files Attached Files

  9. #9
    Banned User!
    Join Date
    02-05-2015
    Location
    San Escobar
    MS-Off Ver
    any on PC except 365
    Posts
    12,168

    Re: Record with year of working

    one way with Power Query (with remarks defined by you see v2)
    remarks Count Average
    Above 2 years
    16
    8793.75
    1 year to 2 year
    5
    7800
    6 months to 1 year
    6
    8166.67
    0 to 6 months
    10
    8700


    and defined by me

    Data Count Average Paid
    0-6 Months
    4
    8375
    1 year to 2 year
    6
    7916.67
    6 months to 1 year
    8
    8937.5
    Above 2 years
    19
    8589.47
    Attached Files Attached Files
    Last edited by sandy666; 10-25-2022 at 06:25 AM.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Record with year of working

    Where do you want a formula? Column I or column L... or both????

    You are also being inconsistent. 6 months counts as 6mo to 1 year. BUT 1 year does NOT count as 1 year to 2 year.

  11. #11
    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,206

    Re: Record with year of working

    The usual question: is 0-6 months .......is it 0 to <= 6 months or 0 to < 6 months (and same for other comparisons).

  12. #12
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Record with year of working

    Row 6 and Row 17 in your example are contradictory. Column F says "6 Months" for both these rows but Column I has different values. You're asking the impossible.

    WBD
    Last edited by WideBoyDixon; 10-25-2022 at 08:15 AM.

  13. #13
    Forum Contributor
    Join Date
    02-16-2011
    Location
    Maharashtra, Thane
    MS-Off Ver
    Excel 2021
    Posts
    140

    Re: Record with year of working

    Dear Mr. Glenn,
    I need the formula to be set in L column based on the value of column F. In I column i have just mentioned the category which it will follow.

    Dear john,
    i need the value to be considered of 6 months from 0 to 6 months and in 6 months to 1 year it will not consider. And where the value 1 year mentioned it will be considered under 6 months to 1 year term and not above. In L column i have mentioned the value manually for which i need a formula.

  14. #14
    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,206

    Re: Record with year of working

    so which - if any - of the responses is correct?

  15. #15
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: Record with year of working

    Try this. It looks (to me) like 4 of your expected answers are incorrect. They are highlighted in cols A to D.
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 10-25-2022 at 12:41 PM.

  16. #16
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Record with year of working

    If that's correct then you can just change the comparison operators in these:

    Please Login or Register  to view this content.
    WBD

+ 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] Formula to get the Year of max record with condition
    By yllew in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-10-2022, 02:30 AM
  2. [SOLVED] Calculate how many times a record occurs in a year to date
    By Perk1961 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-22-2020, 05:15 PM
  3. [SOLVED] Macro to record data on a line not working
    By lemur21 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-26-2017, 04:05 PM
  4. [SOLVED] Need to changeremove same record from two sheets when working on one or the other.
    By Ochimus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-24-2016, 09:12 PM
  5. [SOLVED] Changing a formula that was working in the old year to work in the new year.
    By Manuel Pedro in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-08-2014, 01:49 AM
  6. Replies: 1
    Last Post: 11-16-2012, 09:25 AM
  7. [SOLVED] Record Macro for Custom Sort not Working as I need...
    By LeoThe Lion in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2012, 07:52 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