sum even and odd numbers in a range


Hello,


In C11 I'm trying to find out how to sum all the odd numbers in range C2:D9?


In C12 I'm trying to find out how to sum all the even numbers in range C2:D9?

sum all the odd numbers in C2:D8 and return the value in C10.









Posted on Apr 13, 2021 5:19 PM

Question marked as Top-ranking reply

Posted on Apr 13, 2021 9:18 PM

You table setup is very Excel-like and doesn't lend itself to a compact solution.


However, you could try something like this, where the last to rows are defined as Footer Rows so you can put formulas in them that refer to the entire columns above:




The formula in D2, copied down the column, is =ISODD(C2)


The formula in F2, copied down into cells below it is, is =ISODD(E2)


The formula in C11 is:


=SUMIF(D,TRUE,C)+SUMIF(F,TRUE,E)


The formula in C12 is:


=SUM(C)+SUM(E)−C$11


If your region use , as a decimal separator use ; instead of , in the formulas.


SG


3 replies
Question marked as Top-ranking reply

Apr 13, 2021 9:18 PM in response to Community User

You table setup is very Excel-like and doesn't lend itself to a compact solution.


However, you could try something like this, where the last to rows are defined as Footer Rows so you can put formulas in them that refer to the entire columns above:




The formula in D2, copied down the column, is =ISODD(C2)


The formula in F2, copied down into cells below it is, is =ISODD(E2)


The formula in C11 is:


=SUMIF(D,TRUE,C)+SUMIF(F,TRUE,E)


The formula in C12 is:


=SUM(C)+SUM(E)−C$11


If your region use , as a decimal separator use ; instead of , in the formulas.


SG


Apr 14, 2021 3:16 AM in response to Community User

Hi Shadedlight,


Separate the odd and even values into other tables.



Formula in A2 of the Odds table IF(ISODD(Table 1::C2),Table 1::C2,"")

Fill right and fill down.


Formula in A2 of the Evens table IF(ISEVEN(Table 1::C2),Table 1::C2,"")

Fill right and fill down.




Formula in C11 of Table 1 SUM(Odds::A2:B9)

Formula in C12 of Table 1 SUM(Evens::A2:B9)

You can move (Cut and Paste) the Odds and Evens tables to another Sheet.


If you use Footer rows, these formulas can refer to whole columns and will automatically adjust as you add more rows.

Please reply with questions.


Regards,

Ian.


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

sum even and odd numbers in a range

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.