Something wrong with my formula?

Special-K

Board Regular

I've got a formula that works dandy. But when I modify it to incorporate some changes, it won't work any longer. I don't know why. I've attached the before and after.

If one of you gracious folks can point out where I went wrong, I would be very grateful.

Here's the original Fromula:
=SUMIF(A5:A93,"CO",D5:D93)+SUMIF(A5:A93,"CH",D5:D93)
The formula watches column A for any entries which read "CO" or CH" ... then it will add the totals from there in Column D.

With the new formula, I added a couple of new categories. In addition to "CO, CH, there's also "HC"
=SUMIF(A5:A93,"CO",D5:D93)+SUMIF(A5:A93,"CH",D5:D93)+SUMIF(A5:A93,"HC",D5:D93)

When I enter the new, longer format, it only enters it into the cell as type ... not as a format. I tried Holding the CTRL+ENTER keys down, but that still didn't work.

Kevin.

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

MrHaggis

New Member
Hi Special K
The formula seems ok - looks like it's been entered into a cell previously formatted as text. I'm no expert by any means, but when this happens to me, I format the cell as a value (normally just click on the comma number format on the menu bar, cuz I'm lazy), then click into the beginning of the formula bar and click the checkbox to complete the formula.

Peter_SSs

MrExcel MVP, Moderator
Special-K

Here is another way that would work quickly even if you have a whole column (or multi-column range) of these formulas.
1. Select the column(s)
2. Format|Cells...|General (or Number if that is what you want)|OK
3. Data|Text to Columns...|Finish

barry houdini

MrExcel MVP

=SUM(SUMIF(A5:A93,{"CO","CH","HC"},D5:D93))

Special-K

Board Regular
WONDERFUL! Thank you each for your help.

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,168,049
Messages
5,857,035
Members
431,848
Latest member
David_8055

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back