question

80266070 avatar image
0 Votes"
80266070 asked 80266070 commented

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

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?

office-vba-devoffice-excel-itprooffice-scripts-excel-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

emilyhua-msft avatar image
0 Votes"
emilyhua-msft answered 80266070 commented

Hi @80266070

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I'v found the answer. Thanks for your help!

0 Votes 0 ·