+ Reply to Thread
Results 1 to 8 of 8

Excel: find next smaller number in a column with duplicates for a given number value

  1. #1
    Registered User
    Join Date
    11-04-2017
    Location
    Upington, South Africa
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Excel: find next smaller number in a column with duplicates for a given number value

    I have a Table1 with data set that contains year (Column A), week (Column B) and values (Column C). I want to get the next smaller week in D4 for a given week in Cell D2 and year in D3 i.e. if D2 = 23 and D3 = 2020 the function should return D4 = 20 based on example data below. The thing is there is duplicate years' and weeks' which makes the following functions not work:<br>
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    This whopper I found on this forum sadly only returns the 2nd largest value in a column with duplicates (I am not allowed to post a link):
    Please Login or Register  to view this content.
    Data set in Table1
    Please Login or Register  to view this content.
    Can someone please help to create a function that can look up the next smallest week after a given week in a year?
    Last edited by Hmerman; 06-07-2020 at 03:31 PM. Reason: Add info

  2. #2
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Excel: find next smaller number in a column with duplicates for a given number value

    Can you upload your excel?

  3. #3
    Registered User
    Join Date
    11-04-2017
    Location
    Upington, South Africa
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Post Re: Excel: find next smaller number in a column with duplicates for a given number value

    Hi, thanks for your reply. Yes I can.
    I clicked the Manage Attachment and Uploaded the file. I closed the Manage Upload tab, but don't see my file. The file is only 35KB.
    Do you know how to complete the upload?
    Last edited by Hmerman; 06-08-2020 at 02:19 AM.

  4. #4
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Excel: find next smaller number in a column with duplicates for a given number value

    Hi,
    Please see instructions how to upload your file in the yellow banner at the top of the page.

  5. #5
    Registered User
    Join Date
    11-04-2017
    Location
    Upington, South Africa
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Re: Excel: find next smaller number in a column with duplicates for a given number value

    Okay. I have followed the instructions and although the file shows in the Current Attachments section of the Manage Attachments tab.
    It does not show in the Attachments dropdown in the Post toolbar. It just appears...

    How can I broaden my explanation to give you more information? See attached.
    Attached Files Attached Files
    Last edited by Hmerman; 06-08-2020 at 04:14 AM.

  6. #6
    Forum Contributor
    Join Date
    04-15-2013
    Location
    Singapore, Melbourne
    MS-Off Ver
    Office 365
    Posts
    167

    Re: Excel: find next smaller number in a column with duplicates for a given number value

    E3 is your week number
    E4 is is your year number

    Final formula
    =LARGE(IF(Table13[year]=E3,Table13[week]),COUNTIFS(Table13[year],E3,Table13[week],">="&E2)+1)

  7. #7
    Registered User
    Join Date
    11-04-2017
    Location
    Upington, South Africa
    MS-Off Ver
    MS Office 2013
    Posts
    11

    Re: Excel: find next smaller number in a column with duplicates for a given number value

    Wow! That works fine. Thank you.
    Yeah, sorry about the week and year ranges. I changed it when I uploaded the workbook.

    What does the COUNTIFS() part do in your function?

  8. #8
    Forum Contributor
    Join Date
    04-15-2013
    Location
    Singapore, Melbourne
    MS-Off Ver
    Office 365
    Posts
    167

    Re: Excel: find next smaller number in a column with duplicates for a given number value

    COUNTIFS(Table13[year],E3,Table13[week],">="&E2)

    This part is used to count the number of cells with a year greater than 2020 and a week number greater than or equal to 21

+ 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] Find first number that is smaller than some number but divisible with other number
    By beard in forum Excel Formulas & Functions
    Replies: 25
    Last Post: 07-20-2019, 12:24 PM
  2. [SOLVED] Identification of duplicates numbers in a column and print as duplicates with that number
    By kswapnadevi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-16-2017, 05:25 AM
  3. Replies: 1
    Last Post: 06-10-2013, 07:08 PM
  4. [SOLVED] Find and Get Column Letter and Row Number from Duplicates in Range of Cells
    By WITJ in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-10-2013, 12:23 PM
  5. Find highest revision number in one column of a item number in another column
    By Tasiast in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-01-2013, 01:03 PM
  6. How to find the smaller number in the list
    By kishoremcp in forum Excel General
    Replies: 3
    Last Post: 01-24-2012, 05:21 PM
  7. Replies: 7
    Last Post: 12-18-2008, 07:34 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