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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel IIF statement 1

Status
Not open for further replies.

raven39

Technical User
Joined
May 19, 2004
Messages
23
Location
US
I have an excel workbook that i would like to make an IIF statement in. I have a running total that i need to subtract the closed accounts amounts from.

cell J9 = sum(f4:f999)
cell h4:h999 = "X" <trigger for IIF statement to subtract a closed account amount>

Can anyone help me with the iif statement needed for this?

thanks raven
 
The following will give you the negative value of all numbers in the F column that have an X in the corresponding H column

=SUMPRODUCT((F4:F999)*(H4:H999="x")*-1)

This one will give you a total of all of the values in the F column that do not have an X in the H coulmn
=SUMPRODUCT((F4:F999)*(H4:H999<>"x")*1)



Mike
 
Mike

That works great!!! Thank you!

Raven
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top