Something wrong with my formula?

Special-K

Board Regular
Joined
Apr 18, 2006
Messages
63
Help please ...

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.

Am I doing something wrong here? Please help.

Kevin.
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
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.
 
Upvote 0
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
 
Upvote 0
Not answering your specific question but.....you could simplify that formula to

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

Forum statistics

Threads
1,214,650
Messages
6,120,734
Members
448,987
Latest member
marion_davis

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top