How to use SUM or other functions to sum the cells of the established IF function in Excel?

尉寧 羅 21 Reputation points
2022-04-20T06:03:15.78+00:00

The cell formula of the established IF function is =IF(O2+P2+Q2<=80,"80",IF(O2+P2+Q2<=110,"150",IF(O2+P2+Q2<=140 ,"190",IF(O2+P2+Q2<=140,"190","230"))))

I want to add up these result values, but I can't use SUM to add them up. Is there any other way besides “+” one by one?

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Excel | For business | Windows
Developer technologies | Visual Basic for Applications
0 comments No comments
{count} votes

Accepted answer
  1. Emily Hua-MSFT 27,821 Reputation points
    2022-04-20T08:16:16.697+00:00

    Hi @尉寧 羅

    According to your descruptions, can you share us with a simple sample to show more details?

    > I want to add up these result values, but I can't use SUM to add them up.

    Is the data in O2, P2 and Q2 changed dynamically, you want to capture the results shown in one cell that generated via the formula and add these results together?
    If so, I am afraid you need the VBA code to capture the result each time and do cumulative calculations.
    (But please note, I'm mainly responsible for general issues of Excel client, for VBA code issues, you need to add tag "office-vba-dev". It's recommended to wait for VBA experts' suggestions. Thanks for your understandings.)

    Or does the formula will be dragged down for a range? such as =IF(O3+P3+Q3<=80,"80",IF(O3+P3+Q3<=110,"150",IF(O3+P3+Q3<=140 ,"190",IF(O3+P3+Q3<=140,"190","230")))) and so on,
    If so, you can use SUM function, and apply the formula to the corresponding cell range of results.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



1 additional answer

Sort by: Most helpful
  1. Ashish Mathur 99,580 Reputation points Volunteer Moderator
    2025-07-26T07:15:22.73+00:00

    Hi,

    Remove the double quotes from around the numbers in your formula. The SUM() function should now work.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.