+ Reply to Thread
Results 1 to 5 of 5

Attribute a specific number to a specific cell if conditions are fulfilled

  1. #1
    Registered User
    Join Date
    02-05-2016
    Location
    Kigali
    MS-Off Ver
    excel 2007
    Posts
    21

    Attribute a specific number to a specific cell if conditions are fulfilled

    Hi guys,

    I have attached an excel workbook that shows how i want my data to look like after using the formulas that I hope you'll help me get.

    In summary, I want a formula that distributes the students as follows (note that the maximum number of students per day is 20):

    • If the total number of students is below 21, attribute that number of students to Monday, Wednesday, and Friday column cells
    • If the total number of students is above 20 and below 41, attribute 20 students to Monday and Thursday column cells, and the difference to Tuesday and Friday column cells. e.g: we have 30 students, attribute 20 students to Monday and Thursday, and the remaining 10 to Tuesday and Friday.
    • If the total number of students is above 40 and below 61, attribute 20 students to Monday and Thursday column cells, another 20 to Tuesday and Friday column cells, and the difference to Wednesday and Saturday column cells. e.g: we have 50 students, attribute 20 students to Monday and Thursday, attribute 20 more to Tuesday and Friday, and the remaining 10 to Wednesday and Saturday.

    Thanks for your help.

  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
    28,209

    Re: Attribute a specific number to a specific cell if conditions are fulfilled

    Formula in B2 to G2 respecively

    =IF($A2<=20,$A2,20)

    =IF($A2<=20,"",MIN($A2-20,20))

    =IF($A2<=20,$A2,IF($A2>40,MIN($A2-40,20),""))

    =IF(A2<=20,"",20)

    =IF($A2<=20,$A2,MIN($A2-20,20))

    =IF($A2<=40,"",MIN($A2-40,20))

  3. #3
    Registered User
    Join Date
    02-05-2016
    Location
    Kigali
    MS-Off Ver
    excel 2007
    Posts
    21

    Re: Attribute a specific number to a specific cell if conditions are fulfilled

    Thanks John, it's working perfectly.

  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,209

    Re: Attribute a specific number to a specific cell if conditions are fulfilled

    Glad to have helped.

    If your problem has been addressed could you please mark the thread as solved ("Thread Tools" at top of first post). Thank you.

  5. #5
    Registered User
    Join Date
    02-05-2016
    Location
    Kigali
    MS-Off Ver
    excel 2007
    Posts
    21
    sure, let me do it.

+ 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] Remove duplicate from rows from specific cell/row number to specific cell/row number
    By saravanan1981 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-12-2016, 10:38 PM
  2. [SOLVED] Specific character of a cell to display as specific number on another cell
    By excellenct in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-13-2015, 11:45 AM
  3. Replies: 3
    Last Post: 04-30-2015, 08:00 AM
  4. [SOLVED] how to stop Command button If specific number is entered in a specific cell range
    By sspreyer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2013, 05:10 AM
  5. count number between specific cells given certain conditions
    By blgree8 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-09-2013, 02:36 PM
  6. Hide specific columns dependant on number in specific cell
    By ladbroke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2012, 04:46 PM
  7. Replies: 3
    Last Post: 01-21-2009, 05:37 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