+ Reply to Thread
Results 1 to 11 of 11

Search by fortnight

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    03-31-2012
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2021
    Posts
    174

    Search by fortnight

    Hello friends, I need a new help, I have a column with dates, another with the provider and two with values, I need to find the first and last value every fortnight.
    Grateful Leandro

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

    Re: Search by fortnight

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  3. #3
    Forum Contributor
    Join Date
    03-31-2012
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2021
    Posts
    174

    Re: Search by fortnight

    John follows an example
    Attached Files Attached Files

  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
    30,768

    Re: Search by fortnight

    Thank you for the file:

    I need to understand the pattern: the first set of entries are 25 days apart but it is not obvious to me what the pairing is for 07 Jan, 12 Jan.

    Is based on pairing the "Prod" value i.e a/f, b/b,c/c ? And what is the "Prod" column which currently has 6 and f in consecutive rows.

    Can you please add more examples to your file

  5. #5
    Forum Contributor
    Join Date
    03-31-2012
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2021
    Posts
    174

    Re: Search by fortnight

    John, 1 is the product cod, "a" is the product, I need to find its price in the quarters, the first price in the first quarter and last price in the first quarter, and so on all quarters of the year.
    In the example I put the values that I need to find in Plan1.

    Leandro
    Attached Files Attached Files

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

    Re: Search by fortnight

    See attached:

    I used a "helper" column K to identify the !st/Last values for each month.

    =COUNTIFS($E$2:E2,1,$F$2:F2,"a",$D$2:D2,">=" & EOMONTH(D2,-1)+1,$D$2:D2,"<=" & EOMONTH(D2,0))

    in "Plan 2"

    in E7

    =SUMPRODUCT((Plan1!$I$2:$I$25)*(MONTH(Plan1!$D$2:$D$25)=MONTH(Plan2!E$2))*(Plan1!$K$2:$K$25=1)*(Plan1!$F$2:$F$25="a"))

    in E8

    =SUMPRODUCT((Plan1!$I$2:$I$25)*(MONTH(Plan1!$D$2:$D$25)=MONTH(Plan2!E$2))*(Plan1!$K$2:$K$25=2)*(Plan1!$F$2:$F$25="a"))


    n F7

    =SUMPRODUCT((Plan1!$J$2:$J$25)*(MONTH(Plan1!$D$2:$D$25)=MONTH(Plan2!E$2))*(Plan1!$K$2:$K$25=1)*(Plan1!$F$2:$F$25="a"))

    in F8

    =SUMPRODUCT((Plan1!$J$2:$J$25)*(MONTH(Plan1!$D$2:$D$25)=MONTH(Plan2!E$2))*(Plan1!$K$2:$K$25=2)*(Plan1!$F$2:$F$25="a"))

    Select all 4 cells and copy paste to next month

    I don't know if this is "flexible" enough for your need so maybe see if there a better way of formatting the data in "Plan 1"
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    03-31-2012
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2021
    Posts
    174

    Re: Search by fortnight

    John, I've tried to adapt it to my worksheet, but it's not right, I'm sending you to take a look and help me.
    I realized that you are adding the result, I just need the date value.

    Grateful
    Leandro
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    03-31-2012
    Location
    Sao Paulo
    MS-Off Ver
    Excel 2021
    Posts
    174

    Re: Search by fortnight

    John, Could you help me ??

  9. #9
    Registered User
    Join Date
    08-28-2015
    Location
    Melbourne, AUS
    MS-Off Ver
    2011
    Posts
    59

    Re: Search by fortnight

    updated below
    Last edited by mrshl9898; 03-27-2017 at 06:29 PM.

  10. #10
    Registered User
    Join Date
    08-28-2015
    Location
    Melbourne, AUS
    MS-Off Ver
    2011
    Posts
    59

    Re: Search by fortnight

    Slight ammendment to deal with week 1.

    =IF(IF(OR(WEEKNUM(J4-0)-WEEKNUM(J4-1)<-1,WEEKNUM(J4-0)-WEEKNUM(J4-1)=1),"Sun",IF(OR(WEEKNUM(J4-1)-WEEKNUM(J4-2)=1,WEEKNUM(J4-1)-WEEKNUM(J4-2)<-1),"Mon",IF(OR(WEEKNUM(J4-2)-WEEKNUM(J4-3)=1,WEEKNUM(J4-2)-WEEKNUM(J4-3)<-1),"Tues",IF(OR(WEEKNUM(J4-3)-WEEKNUM(J4-4)=1,WEEKNUM(J4-3)-WEEKNUM(J4-4)<-1),"Wed",IF(OR(WEEKNUM(J4-4)-WEEKNUM(J4-5)=1,WEEKNUM(J4-4)-WEEKNUM(J4-5)<-1),"Thurs",IF(OR(WEEKNUM(J4-5)-WEEKNUM(J4-6)=1,WEEKNUM(J4-5)-WEEKNUM(J4-6)<-1),"Fri",IF(OR(WEEKNUM(J4-6)-WEEKNUM(J4-7)=1,WEEKNUM(J4-6)-WEEKNUM(J4-7)<-11),"Sat","")))))))="Mon",TEXT(J4,"dd/mm/yyyy")&" - "&TEXT(J4+14,"dd/mm/yyyy"),IF(IF(OR(WEEKNUM(J4-0)-WEEKNUM(J4-1)<-1,WEEKNUM(J4-0)-WEEKNUM(J4-1)=1),"Sun",IF(OR(WEEKNUM(J4-1)-WEEKNUM(J4-2)=1,WEEKNUM(J4-1)-WEEKNUM(J4-2)<-1),"Mon",IF(OR(WEEKNUM(J4-2)-WEEKNUM(J4-3)=1,WEEKNUM(J4-2)-WEEKNUM(J4-3)<-1),"Tues",IF(OR(WEEKNUM(J4-3)-WEEKNUM(J4-4)=1,WEEKNUM(J4-3)-WEEKNUM(J4-4)<-1),"Wed",IF(OR(WEEKNUM(J4-4)-WEEKNUM(J4-5)=1,WEEKNUM(J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



    Also realised you may be looking at 26 fortnights as opposed to 52-53.... I found a solution, but it doesn't handle years with 53 weeks.. (cannot seem to upload the file)

    Column Z =WEEKNUM(J4)

    Column AA =ISODD(Z4)

    Column AB =IF(OR(WEEKNUM(J4-0)-WEEKNUM(J4-1)<-1,WEEKNUM(J4-0)-WEEKNUM(J4-1)=1),"Sun",IF(OR(WEEKNUM(J4-1)-WEEKNUM(J4-2)=1,WEEKNUM(J4-1)-WEEKNUM(J4-2)<-1),"Mon",IF(OR(WEEKNUM(J4-2)-WEEKNUM(J4-3)=1,WEEKNUM(J4-2)-WEEKNUM(J4-3)<-1),"Tues",IF(OR(WEEKNUM(J4-3)-WEEKNUM(J4-4)=1,WEEKNUM(J4-3)-WEEKNUM(J4-4)<-1),"Wed",IF(OR(WEEKNUM(J4-4)-WEEKNUM(J4-5)=1,WEEKNUM(J4-4)-WEEKNUM(J4-5)<-1),"Thurs",IF(OR(WEEKNUM(J4-5)-WEEKNUM(J4-6)=1,WEEKNUM(J4-5)-WEEKNUM(J4-6)<-1),"Fri",IF(OR(WEEKNUM(J4-6)-WEEKNUM(J4-7)=1,WEEKNUM(J4-6)-WEEKNUM(J4-7)<-11),"Sat","")))))))

    Column AC =IF(OR(WEEKNUM(J4-0)-WEEKNUM(J4-1)<-1,WEEKNUM(J4-0)-WEEKNUM(J4-1)=1),"Sun",IF(OR(WEEKNUM(J4-1)-WEEKNUM(J4-2)=1,WEEKNUM(J4-1)-WEEKNUM(J4-2)<-1),"Mon",IF(OR(WEEKNUM(J4-2)-WEEKNUM(J4-3)=1,WEEKNUM(J4-2)-WEEKNUM(J4-3)<-1),"Tues",IF(OR(WEEKNUM(J4-3)-WEEKNUM(J4-4)=1,WEEKNUM(J4-3)-WEEKNUM(J4-4)<-1),"Wed",IF(OR(WEEKNUM(J4-4)-WEEKNUM(J4-5)=1,WEEKNUM(J4-4)-WEEKNUM(J4-5)<-1),"Thurs",IF(OR(WEEKNUM(J4-5)-WEEKNUM(J4-6)=1,WEEKNUM(J4-5)-WEEKNUM(J4-6)<-1),"Fri",IF(OR(WEEKNUM(J4-6)-WEEKNUM(J4-7)=1,WEEKNUM(J4-6)-WEEKNUM(J4-7)<-11),"Sat","")))))))

  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
    30,768

    Re: Search by fortnight

    I am sorry but you example does not clarify (to me) what is required:

    Take your example of "Ovalado 14x16 x 1250m"

    there are 4 entries with dates of 14/03/201, 02/03/2017, 15/03/2017 and 02/03/2017

    In you table in "Dados" you have entries in January (March?) which are "amounts": you say you want "dates" so should the entries be 02/03/2017 (Wed) and 15/03/2017 (Thu) which are not 14 days apart?

    Why not 14/03/2017 and 02/03/2017?

    So basically, I do not understand the logic behind any selection.

+ 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] Working days & Working days passed in a fortnight
    By nagesh.tvsr in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-24-2016, 07:53 AM
  2. Formula to Create Rolling Fortnight dates
    By mchilapur in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-25-2016, 02:14 PM
  3. [SOLVED] Get the Correct Fortnight Date
    By SBBmaster09 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-30-2016, 05:40 AM
  4. VBA Code - Search text & search number & search qty and result - Urgent Please
    By naresh73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2014, 10:51 AM
  5. Equation to add X hours every Fortnight
    By Trace86 in forum Excel General
    Replies: 2
    Last Post: 09-28-2011, 08:19 PM
  6. Excel PAY AS YOU EARN (PAYE) FORTNIGHT TAX CALCULATOR
    By Hailey & Hayden in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-20-2010, 03:15 PM
  7. [SOLVED] Fortnight
    By j.mcgown in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-16-2005, 09:06 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