Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtotal with Condition formula 1

Status
Not open for further replies.

CandyS

Technical User
Jun 5, 2003
137
US
Dearest Wizards,

I'm trying to create a formula whereby the subtotal will only return a value IF the cell above it becomes populated.

Cell B2 has a FilterCriteria formula in it (that's dependent on a very useful VBA script by a fellow named Stephen Bullen--I got it from the J-Walk website). It populates the cell ONLY if I choose a filter criteria in cell B4 (AutoFilter is on for the entire Row.

I want to put a conditional subtotal formula in B3 that will return a value ONLY if cell B2 becomes populate (...with the filter criteria I choose in cell B4).

Here is my attempt, and, of course, it doesn't work!
=IF(B2>" ",(SUBTOTAL(3,B5:B16897),0)

I have the SUBTOTAL formula down solid, it just adding the IF condition that's giving me trouble.

I appreciate your help.

Regards,

Candy




 
Your If statement looks good however the problem may be with your data.

If b2 has a numeric value then your result will be zero
If b2 has a alpha value it may be ok.

What is in b2?

 
Actually I ment to change your syntax to the following

=IF(B4 >0,SUBTOTAL(3,B4:B16897),0)
 
mscallisto,

I just changed the "0" at the end to " " (space) and it works like a charm--thanks for your help!

Regards,

Candy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top