+ Reply to Thread
Results 1 to 9 of 9

Help on Easy If Function

  1. #1
    Registered User
    Join Date
    07-26-2012
    Location
    Akron, Ohio
    MS-Off Ver
    Excel 2003
    Posts
    16

    Help on Easy If Function

    I have this in my cell and it wont work.

    =IF($DB$4=1,B9,IF($DB$4=2,B9+H9,IF($DB$4=3,B9+H9+N9,IF($DB$4=4,B9+H9+N9+T9,IF($DB$4=5,B9+H9+N9+T9+Z9,IF($DB$4=6,B9+H9+N9+T9+Z9+AF9,IF($DB$4=7,B9+H9+N9+T9+Z9+AF9+AL9,IF($DB$4=8,B9+H9+N9+T9+Z9+AF9+AL9+AR9,IF($DB$4=9,B9+H9+N9+T9+Z9+AF9+AL9+AR9+AX9,""))))))))


    It always highlights on the bold part

    Help

  2. #2
    Forum Contributor CheshireCat's Avatar
    Join Date
    10-11-2011
    Location
    Victoria, Canada
    MS-Off Ver
    Excel 2003 & 2010
    Posts
    258

    Re: Help on Easy If Function

    How about:

    Please Login or Register  to view this content.
    Docendo discimus.

  3. #3
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Help on Easy If Function

    RMGraham,

    Perhaps like this instead?
    Please Login or Register  to view this content.

    [EDIT]
    Nice use of Choose, CheshireCat
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Help on Easy If Function

    It looks as if you have a space between one of your variable names. Why not try this:
    =CHOOSE($DB$4,B9,B9+H9,B9+H9+N9,B9+H9+N9+T9,B9+H9+N9+T9+AF9,B9+H9+N9+T9+AF9,B9+H9+N9+T9+AF9+AL9,B9+H9+N9+T9+AF9+AL9+AR9,B9+H9+N9+T9+AF9+AL9+AR9+AX9)
    Last edited by K m; 07-27-2012 at 02:47 PM.
    Click on star (*) below if this helps

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Help on Easy If Function

    easiest is with a helper to create a contiguous array and a dynamic range
    edited to include col z
    Attached Files Attached Files
    Last edited by martindwilson; 07-28-2012 at 05:11 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Help on Easy If Function

    looks you are summing every 6th column, so Try this,

    =SUMPRODUCT((MOD(COLUMN(B9:AX9)-COLUMN(B9),6)=0)*(COLUMN(B9:AX9)-COLUMN(B9)+1<=A1*6),B9:AX9)
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Help on Easy If Function

    hasseb a what about col z and where is the value in db4 taken into consideration?

  8. #8
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Help on Easy If Function

    Hello Martin,

    I don't see any specialty with column Z. Since 5th number OP has Z9 on sum range. For DB4 it was typo, A1 should be DB4. here is the corrected version.

    =SUMPRODUCT((MOD(COLUMN(B9:AX9)-COLUMN(B9),6)=0)*(COLUMN(B9:AX9)-COLUMN(B9)+1<=$DB$4*6),B9:AX9)
    Last edited by Haseeb Avarakkan; 07-27-2012 at 08:32 PM.

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Help on Easy If Function

    slightly shorter than above this works
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    apologies hasseb a by post #4 which i looked at col z was missing
    B9+H9+N9+T9+AF9+AL9+AR9+AX9
    Last edited by martindwilson; 07-28-2012 at 05:45 AM.

+ 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