+ Reply to Thread
Results 1 to 5 of 5

Too much arguments in one cell

  1. #1
    Registered User
    Join Date
    03-20-2010
    Location
    Portugal
    MS-Off Ver
    Excel 2019
    Posts
    69

    Unhappy Too much arguments in one cell

    Hello,

    I have a cell (F10) that picks up values from cells B10 and C10 that have times, for example if cell B10 or cell C10 have 11:00 hours i recieve in cell F10 5 euros.

    i have this logical function in cell F10:

    =IF(AND(B10>=TIME(0;0;0);B10<=TIME(13;0;0);NOT(B10 =""));5;IF(AND(B10>TIME(13;0;0);B10<=TIME(21;0;0)) ;10;IF(AND(B10>TIME(21;0;0);B10<=TIME(23;59;59));1 5;IF(AND(C10>=TIME(0;0;0);C10<=TIME(13;0;0);NOT(C1 0=""));5;IF(AND(C10>TIME(13;0;0);C10<=TIME(20;0;0) );10;IF(AND(C10>TIME(20;0;0);C10<=TIME(23;59;59)); 15; IF(AND(NOT(B10="";C10=""));20;0)))))))

    Its all working fine but excel says that i have too many arguments, its possible to shrink this ?

    This last part is to when the both cells B10 and C10 have some kind of time i want the value 20 euros in cell F10.
    IF(AND(NOT(B10="";C10=""));20;0)))))))

    Thanks
    Last edited by Blue_Wings; 03-24-2010 at 05:35 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: Too much arguments in one cell

    See example if it's working for you:
    Attached Files Attached Files
    Last edited by zbor; 03-21-2010 at 02:53 PM.

  3. #3
    Registered User
    Join Date
    03-20-2010
    Location
    Portugal
    MS-Off Ver
    Excel 2019
    Posts
    69

    Re: Too much arguments in one cell

    Quote Originally Posted by zbor View Post
    See example if it's working for you:
    It helps a lot but when i put 22:34 inside cell B10 for example ir doesnt put the correct number in cell F10, where do i put the function TIME() ?

    Thanks

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,627

    Re: Too much arguments in one cell

    Yes, sorry.. No need for TIME function just divide by 24:

    =IF(AND(B10="";C10="");0;IF(B10*C10>0;20;MAX(LOOKUP(MOD(B10;24);{0;13;21}/24;{5;10;15});LOOKUP(MOD(C10;24);{0;13;20}/24;{5;10;15}))))

    If your results are equal you can join them into one formula but in your example B10 are fo 0:00, 13:00 and 21:00 and C10 for 0:00, 13:00 and 20:00

  5. #5
    Registered User
    Join Date
    03-20-2010
    Location
    Portugal
    MS-Off Ver
    Excel 2019
    Posts
    69

    Re: Too much arguments in one cell

    Problem solved, with this:


    =IF(AND(C13>=TIME(0;0;0);C13<=TIME(23;59;59);NOT(C13="");B13>=TIME(0;0;0);B13<=TIME(23;59;59);NOT(B13=""));30;IF(AND(B13>=TIME(0;0;0);B13<=TIME(13;0;0);NOT(B13=""));65;IF(AND(B13>TIME(13;0;0);B13<=TIME(21;0;0));45;IF(AND(B13>TIME(21;0;0);B13<=TIME(23;59;59));30;IF(AND(C13>=TIME(0;0;0);C13<=TIME(13;0;0);NOT(C13=""));0;IF(AND(C13>TIME(13;0;0);C13<=TIME(20;0;0));15;IF(AND(C13>TIME(20;0;0);C13<=TIME(23;59;59));30;IF(OR(B13="x";B13="X");65;""))))))))

    But i am gonna try your way, thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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