+ Reply to Thread
Results 1 to 9 of 9

Restrict entries of similar dates

  1. #1
    Registered User
    Join Date
    04-25-2019
    Location
    mumbai
    MS-Off Ver
    2003
    Posts
    3

    Restrict entries of similar dates

    Hi friends,
    I have been making this planning sheet, where the dates for planning for products should be restricted. For eg : you can make only 8 products for any particluar day, for the 9th product, the planning date should automatically either the next day or the previous day. This way on any day, the planning will be only for 8 products or less and not more. I hav tried countif, MAX, MIN but didnot help.
    Can anyone help.

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Restrict entries of similar dates

    Hello nishantnambiar and Welcome to Excel Forum.
    If you could provide us with a sample of your spreadsheet we may be able to do something to help. Be sure to manually include the expected outputs so that we can compare them to our formulas/code.
    To upload a sample workbook (not a picture or pasted copy) click on the GO ADVANCED button below the Quick Reply window and then scroll down to Manage Attachments to open the upload window.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Registered User
    Join Date
    04-25-2019
    Location
    mumbai
    MS-Off Ver
    2003
    Posts
    3

    Re: Restrict entries of similar dates

    Hi there,
    Thanks for your reply. I have attached the file and explained what is needed. Hope this information would be sufficient.

    Thanks again in advance.

    Regards,

    Nishant Nambiar
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Restrict entries of similar dates

    Would you manually add the results you expect to see for column F.

    In post #1 you are specifying a restriction of 8 products per day yet this is exceeded in C7 but F7 still shows the 10/5/2019

    Also please clarify the explanation for the Hydro test. I don't know what you expect to see when there are more than 5 products on a single day.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Restrict entries of similar dates

    This is about as "Low Tech" as it gets.
    1. Convert the range B3:H29 into a table,
    2. Sort the delivery date column "oldest to newest",
    3. Paste the following in I4 and copy down: =E4-10
    4. Paste the following in J4 and double click to copy down: =ROUNDDOWN((COUNTIF(I$4:I4,I4)-1)/5,0)
    5. Paste the following in K3: =COUNTIF(J4:J29,">0")
    6. Paste the following in K4 and double click to copy down: =I4-J4
    7. Select J3:K29 and drag the fill handle to the right until the value in row 3 is zero, as occurred in cell S3 of the attached file.
    8. Paste the following in F4 and copy down to populate the "Hydro Planned Dates" column: =INDEX(K4:AA4,MATCH(0,K$3:AA$3,0))
    Let us know if you have any questions.
    Attached Files Attached Files

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

    Re: Restrict entries of similar dates

    ARRAY Formula in F4 then copy down.

    =IFERROR(LARGE(IF((COUNTIF($F$3:$F3,($E4-9-ROW($1:$10)))<5),($E4-9-ROW($1:$10)),""),1),"")

    How ARRAY formula is entered

    Paste Formula in the cell.
    Press F2
    Hold Shift+ Ctrl Keys and hit Enter key.
    Now the formula is surrounded by {} by excel.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 05-06-2019 at 04:39 AM.
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  7. #7
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,223

    Re: Restrict entries of similar dates

    One point notice : column "E" & "H" Dates are not corrected format.
    Choose location as : English United States.


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  8. #8
    Registered User
    Join Date
    04-25-2019
    Location
    mumbai
    MS-Off Ver
    2003
    Posts
    3

    Re: Restrict entries of similar dates

    Hi sir,
    Thanks for your reply. This seems to be working fine for the sheet I have attached, but when I added dates further, after row 53 all the dates going blank(sheet attached for your reference).
    Also if you could explain the how the formula is devised, would help me to understand it better.


    Thanks in advance,


    Regards,

    Nishant Nambiar

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

    Re: Restrict entries of similar dates

    In this formula you get 10 dates before the given date.
    =IFERROR(LARGE(IF((COUNTIF($F$3:$F3,($E4-9-ROW($1:$10)))<5),($E4-9-ROW($1:$10)),""),1),"")

    In this you can get 30 dates. Changed portion is in red.
    =IFERROR(LARGE(IF((COUNTIF($F$3:$F3,($E4-9-ROW($1:$30)))<5),($E4-9-ROW($1:$30)),""),1),"")

    If you want still more dates increase it further.
    Last edited by kvsrinivasamurthy; 05-13-2019 at 07:01 AM.

+ 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] restrict a search to either text entries or date entries when loading dynamic userform
    By nigelog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-28-2017, 06:06 AM
  2. Restrict Entries based on Another Cell Value
    By emsjunkie310 in forum Excel General
    Replies: 3
    Last Post: 08-28-2016, 10:22 AM
  3. [SOLVED] Restrict entries in textboxes on userform
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 12-25-2015, 02:19 PM
  4. Restrict textbox entries to numbers
    By domnisignis18 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-11-2013, 03:48 AM
  5. Restrict entries according to date in another cell
    By Canajun in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 12-10-2008, 12:47 AM
  6. Restrict Data Entry to only 4 possible entries
    By ph8 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2006, 11:25 AM
  7. [SOLVED] RE: Restrict Data Entry to only 4 possible entries
    By Tom Ogilvy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2006, 11:15 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