ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   formula for adding every other cell in Excel (https://www.excelbanter.com/excel-worksheet-functions/66860-formula-adding-every-other-cell-excel.html)

Michelle Odell

formula for adding every other cell in Excel
 
Trying to add cell vaules in a very large workbook, but I only need the value
of every other cell. What is the easiest why to do this?

Ron Coderre

formula for adding every other cell in Excel
 
Try something like this:

For numbers in cells A1:A10
B1: =SUMPRODUCT((MOD(ROW(A1:A10),2)=0)*A1:A10)

If you want the "other" cells added, instead:
B1: =SUMPRODUCT((MOD(ROW(A1:A10),2)=1)*A1:A10)

Does that help?

***********
Regards,
Ron

XL2002, WinXP-Pro


"Michelle Odell" wrote:

Trying to add cell vaules in a very large workbook, but I only need the value
of every other cell. What is the easiest why to do this?


Philip Reece-Heal

formula for adding every other cell in Excel
 
Michelle
Might not be the easiest way but if you create another column to the right
of the column you want to sum and enter the following formula in each cell:
=IF(MOD(ROW(),2)=1,,RC[-1])
This divides the row number by 2 and if there is a remainder, it concludes
that the row number is an odd number and gives the answer 0. If the row
number is even it copies the value from the preceding column. Now all you
have to do is Sum the new column to get total for every odd row.

If you want every even row instead, then use
=IF(MOD(ROW(),2)=0,,RC[-1])

Someone may well come up with something simpler but maybe this will do for
the time being
Regards
Philip


"Michelle Odell" <Michelle wrote in message
...
Trying to add cell vaules in a very large workbook, but I only need the
value
of every other cell. What is the easiest why to do this?





All times are GMT +1. The time now is 11:44 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com