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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)

MrHaggis

New Member
Joined
Oct 6, 2006
Messages
18
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
Joined
May 28, 2005
Messages
49,213
Office Version
  1. 365
Platform
  1. Windows
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
Joined
Mar 23, 2005
Messages
20,825
Not answering your specific question but.....you could simplify that formula to

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

Watch MrExcel Video

Forum statistics

Threads
1,133,457
Messages
5,658,875
Members
418,475
Latest member
ExcelBeginner233

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
Top