Excel/excel sumif


Thanks for your help
Here's my dilema:
- im using excel 2010
- ive a number of rows, each one displays some fields ive exported from a database
- one row per record
- at the top i have a stats table that analyses some of the data from the rows
- my rows of data start at row 27 onwards for about 100 further rows in total
- in the stats table, i need a formula to calculate:
if the name in column A = FRED, and if the cell in column H on that same row is not blank, then count it.
- there will be multiple rows which meet this criteria
- i also need a similar formula: if name in column A = FRED, then sum the amount in column K, for all rows that meet this (NB column K may contain an amount or it may be blank)

Many thanks for any help you can give

ANSWER: =COUNTIFS(A27:A126,"Fred",H27:H126,"<>")

---------- FOLLOW-UP ----------

QUESTION: Thanks bob, easy when you know how!

Ive implemented this, with some minor variations, and now have a followp please:

i need to add an exception to a sumif.
I have: =SUMIF($A$19:$A$70,"fred",$E$19:$E$70)+ SUMIF($A$19:$A$70,"fred",$F$19:$F$70)
but i want to add to this formula the condition: discount any figures in column E where there is a figure in column K
discount any figures in column F where there is a figure in column L.
I think i need to use sumifs, but i cant work out the rest.

column A = name
column E = estimated travel costs
column F = estimated accommodation costs
column K = actual travel costs
column L = actual accommodation costs
Data = rows 19:70

Im creating a stats table at the top and need to work out how much is remaining to be spent for each person (their name can appear on multiple rows in the data). For example, how much does fred have left to spend?
I need to add up his all his estimated costs,
then discount any estimated costs from the summing where actual costs have been entered (this is not in all cases).

Is this possible?

Many thanks for your help

Yes, it's possible, but whatg do you mean by discount? Is that a percentage of something or just subtract the value showing.
And, byt the way, your initial formula could be changed from
=SUMIF($A$19:$A$70,"fred",$E$19:$E$70)+ SUMIF($A$19:$A$70,"fred",$F$19:$F$70)
About Excel
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


All Answers

Answers by Expert:

Ask Experts


Bob Umlas


I`m a Microsoft Excel MVP (Most Valuable Professional) and have been since the inception of the program in 1995. I can answer every kind of Excel question except: API, Importing/exporting to other programs (powerpoint, word,...) Also check out my in-person training link at http://www.thumbtack.com/ny/new-york/excel-training/


Worked with MS Excel since version 0.99 (on the Mac!). Was contributing editor to Excellence Magazine, having written >300 articles. John Walkenbach said of me "I finally met someone who knows as much about Excel as I do."

Excellence, The Expert, Microsoft

BA in math, Hofstra University, 1965

Awards and Honors
Led sessions for the Convergence 2004-2006 seminar on Excel tips & tricks

©2017 About.com. All rights reserved.