+ Reply to Thread
Results 1 to 7 of 7

Adding columns based off of adjacent columns.

  1. #1
    Registered User
    Join Date
    10-10-2013
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    3

    Adding columns based off of adjacent columns.

    Need help on creating a function that meets criteria and give total.

    I would like to add what is in columns D,F,H,J,L,N,P if the adjacent column has "R" in the field.
    For example if E2="R" then add D2 and if G2="R" add F2, etc, etc
    Excel.png
    Thanks

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Adding columns based off of adjacent columns.

    Hi,

    i presume from your attachment that by 'adjacent' you actually mean subsequent.

    Try this array formula (important that you know how to enter this type of formula in Excel):

    =SUM(IF(D2:Q2="R",C2:P2))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    10-10-2013
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Adding columns based off of adjacent columns.

    The formula doesn't work. It just shows as text in the cell.

  4. #4
    Forum Expert
    Join Date
    09-20-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    2,278

    Re: Adding columns based off of adjacent columns.

    Hello

    I find you can do this with Sumif without entering as an array if you prefer not to use them>

    Please Login or Register  to view this content.
    DBY

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Adding columns based off of adjacent columns.

    "The formula doesn't work. It just shows as text in the cell."

    Then perhaps your cell is formatted as text (?).

    Regards

  6. #6
    Registered User
    Join Date
    10-10-2013
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Adding columns based off of adjacent columns.

    The formula given above adds all of the fields. I want it to do the following:

    I want it to add only the columns that have an "R" in the adjacent column to it.
    So since E2 is an R it would add D2 to the total, etc...

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Adding columns based off of adjacent columns.

    Did you verify whether the cell containing the formula I posted was not formatted as text?

    Did you also ensure you entered it as an array formula (are you sure you know how to do this)?

    Regards

+ 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. Replies: 1
    Last Post: 03-09-2013, 02:55 PM
  2. [SOLVED] Conditional Formatting Columns Based on Text from Adjacent Column
    By mejiamang in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-18-2012, 10:41 PM
  3. Formula based on variable number of non-adjacent columns
    By abousetta in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-19-2010, 04:22 AM
  4. Adding one if there is data in adjacent columns
    By DentonHTHS in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-21-2008, 10:11 AM
  5. formula for adding 4 adjacent columns & dividing result by 1.833
    By FredricJLowe in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-09-2006, 07:59 PM

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