New Contributor

# Sum up list of selected columns

Hi all,

Is there any way that allows to sum up all selected columns based on row?

My main source is a report that contains 100++ columns and 1000++  rows, but I only want to sum up the selected 50 columns.

Formula with Index Match will be too long and I had tried to google up but cannot find a suitable solution.

Is any expert here willing to share your ideas?

Add-on: As data is confidential so unable to share out sample data

8 Replies

# Re: Sum up list of selected columns

Excel provides the SUM() function.

Some ideas?

# Re: Sum up list of selected columns

Thanks @Detlef Lewin for your response but the simple SUM formula unable to solve my problem

# Re: Sum up list of selected columns

Thanks Peter! However i don't think sumifs is appropriate as i got 50 columns

# Re: Sum up list of selected columns

Could you please share an example with basic data of what you are trying to achieve? Not sure if I understand what the problem that you are trying to solve is.

# Re: Sum up list of selected columns

The catch with SUMIFS is that the array 'mask' must be of the same dimensions as the original table. That essentially doubles the memory committed to your data. On the other hand the '...IFS' functions execute very fast. The FILTER function is best but requires Excel 365, but then, traditional Excel couldn't hit the trash can fast enough for me; I dislike traditional spreadsheet practices intensely! Probably the nested SUM/IF is the most widely deployable technique.

A further note: my row array 'selectedColumns' comprised 0/1 flags to indicate whether the column is required or not.

# Re: Sum up list of selected columns

@TheRuster Hi Ruster, may refer the table below

I got 10 columns, and I only want to sum up 4 columns for each staff.
The basic sum or index match will do but as in my original post, I got more than 50 columns that need to be sum up at last.

Not sure if there is any faster way for this.

# Re: Sum up list of selected columns

@SookChing , you don't need 50 MATCHs, it could be as

``=SUM(INDEX(range,ROW()-ROW(\$B\$2),{1,4,7,8}))``

and drag it down. Or, if you have list of columns to sum

``=SUM(INDEX(range,ROW()-ROW(\$B\$2),XMATCH(columnNames, headers))``