You are here:

# Excel/COUNTIF Function in EXCEL 2007

Question
Hi Tom,
I need help with a countif formula:

I have a table:
- In column A (A2:A25): The days of the week (Monday, Tuesday, Wednesday... Sunday, Monday...Wednesday).
- In column B (B2:B25): numbers 2 through 25 (2,3,4... 8,9,...25).

I have another table:
- In row 2 (G2:M2): Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday.
- In row 3 (G3:M3): Total number for each day; this where I need help. I assume I should use a COUNTIF formula in cells G3:M3 which, in cell G3 for instance, will look through cells A2:A25 to locate cells that have "Monday" as value and compute the total of the corresponding numbers in cells B2:B25; for H3, it will be "Tuesday" and so on...

Hi,

If I correctly understand the situation and the cells A2:A25 and B2:M2 actually contain strings values like "Monday" and "Tuesday" then

G3:  =sumif(\$A\$2:\$A\$25,G\$2,\$B\$2:\$B\$25)

then drag fill to the right to M3

--
Regards,
Tom Ogilvy

This topic answers questions related to Microsoft Excel spreadsheet (or workbook) stand-alone or Mircrosoft Office Excel including Excel 2003, Excel 2007, Office 2000, and Office XP. You can get Excel help on Excel formulas(or functions), Excell macros, charting in Excel, advanced features, and the general use of Excel. This does not provide a general Excel tutorial nor the basics of using a spreadsheet. It provides specific answers to using Microsoft Excel only. If you do not see your Excel question answered in this area then please ask an Excel question here

#### Tom Ogilvy

##### Expertise

Selected as an Excel MVP by Microsoft since 1999. Answering Excel questions in Allexperts since its inception in 2001. Able to answer questions on almost all aspects of Excel's internal capabilities. If seeking a VBA solution, please specify that in your question itself so I give you the answer you want. [Excel has weak protection - if you are distributing an application, I don't answer questions on how to protect your project from your users.]

##### Experience

Extensive experience.

Education/Credentials
Master of Science (MS) degree Operations Research (ORSA)

Awards and Honors
Microsoft MVP in Excel.