Share via

Excel - adding odd numbers in a cell

Anonymous
2017-08-07T15:57:03+00:00

Hi,

I'm trying to create a function that will only add odd numbers in a single cell, in Excel. Is there a way of doing this without using VBA or using add ins like "Ku-Tools for excel"?

Thanks

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

4 answers

Sort by: Most helpful
  1. Anonymous
    2017-08-07T21:27:58+00:00

    Now I see; you want to sum the odd digits in a number

    hope this helps

    Formula in A2 is

    =SUMPRODUCT(MOD(MID(A1,ROW(A1:INDIRECT("A"&LEN(A1))),1),2)*MID(A1,ROW(A1:INDIRECT("A"&LEN(A1))),1))

    best wishes

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2017-08-07T19:30:37+00:00

    The data is in D1:D10

    The sum of odd numbers is found in D13 using a SUMPRODUCT formula

    Note ISODD will not work within SUMPRODUCT, so I used the MOD test

    best wishes

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2017-08-07T17:59:03+00:00

    Sorry i worded my question in-correctly. 

    I don't want to create a function, i want to create a formula to add odd digits in a numbers, without using "user-defined functions" and VBA

    Eg: if a1 had the number 28975

    the odd numbers would sum up to 21. 

    What does the cell B1 refer to in your formula? 

    Is it possible at all?

    Thanks

    Jay.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2017-08-07T17:10:06+00:00

    if you want to create a function, then it has to be coded in some way.   Generally that is in VBA. 

    You can possibly achieve the functionality you want just by combining built in functions.  But that would be a "complex" function in a cell.   Generally you couldn't use built in functions to define a generalized new function.

    =IF(ISODD(A1),A1+B1,0)

    --

    Regards,

    Tom Ogilvy

    Was this answer helpful?

    0 comments No comments