+ Reply to Thread
Results 1 to 5 of 5

Improve/Shorten IF Formula

  1. #1
    Registered User
    Join Date
    12-02-2010
    Location
    Loxton, Australia
    MS-Off Ver
    Excel 2003
    Posts
    1

    Improve/Shorten IF Formula

    Hi,
    Is there anyway to shorten the below formula and therefore be able to inlcude more??
    The 'C' cells will either have YES or NO; if NO i want the corresponding value in the 'G' cells to be added to a total but if YES i don't want it added. There is a limit of how many of these you can have in the formula and i have many more cells to include.

    Any help would be much appreciated!!
    Saint

    =IF(C2="NO",+G2,0)+IF(C3="NO",+G3,0)+IF(C4="NO",+G4,0)+IF(C5="NO",+G5,0)+IF(C6="NO",+G6,0)+IF(C7="NO",+G7,0)+IF(C8="NO",+G8,0)+IF(C9="NO",+G9,0)+IF(C10="NO",+G10,0)+IF(C11="NO",+G11,0)+IF(C12="NO",+G12,0)

  2. #2
    Valued Forum Contributor
    Join Date
    08-23-2009
    Location
    Hampshire, UK
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    328

    Re: Improve/Shorten IF Formula

    You could use SUMIF(C2:C100,"No",G2:G100)

  3. #3
    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: Improve/Shorten IF Formula

    Hi,

    Please Login or Register  to view this content.
    change the row ref 100 as required.

    Rgds
    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.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,893

    Re: Improve/Shorten IF Formula

    This also works:

    =IF($C$2:$C$12="NO",$G$2:$G$12,0)

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Improve/Shorten IF Formula

    Quote Originally Posted by alansidman View Post
    This also works:

    =IF($C$2:$C$12="NO",$G$2:$G$12,0)

    Alan
    Hi alansidman,
    Did you try this?

+ 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