+ Reply to Thread
Results 1 to 4 of 4

Summing a range in a variable column

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Summing a range in a variable column

    Hi,

    I have sample data in columns A to C of the attached file and would like to calculate in cell G2 the total value from columns B and C for the country indicated in cell F2.

    So, for example, F2 contains the country “Belgium” so the formula in G2 should return the sum of all values in column C.

    The wrinkle is that when I receive the data next month the column headed “Belgium” may not be in column C; it could be in any column from B to Z.

    Can someone please suggest a formula to use in G2 that will achieve this?

    Thanks!

    PS I realise that the data in columns F and G should be further to the right to accommodate data in the columns to Z; I’ve placed it where it is to make the worksheet easier to read.
    Attached Files Attached Files

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Summing a range in a variable column

    Hi Andrew,

    Try this formula

    =SUM(INDEX($B$2:$C$7,0,MATCH(F$2,$B$1:$C$1,0)))
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Re: Summing a range in a variable column

    Thanks very much!

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Summing a range in a variable column

    I suggest that you put AlKey's formula on a separate worksheet and not in column G with the following amendment. This would allow for data to be to column Z as you state and as many rows as is required.

    This is just an "expansion" of AlKey's formula in case you were wondering how to accommodate the data that you indicate that you might get.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

+ 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. Summing with a variable range
    By andrewc in forum Excel General
    Replies: 5
    Last Post: 03-25-2015, 01:18 PM
  2. Summing Variable Range in a Column from Below
    By Fr33agent in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-12-2013, 01:19 PM
  3. [SOLVED] Summing a variable range of columns
    By Richard Buttrey in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  4. Summing a variable range of columns
    By Richard Buttrey in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  5. Summing a variable range of columns
    By Richard Buttrey in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM
  6. [SOLVED] Summing a variable range of columns
    By Richard Buttrey in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-28-2005, 02:06 PM
  7. Summing a variable range of Columns
    By blakemiller@ear in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-25-2005, 07:00 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