ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   More than one IF Statement (https://www.excelbanter.com/excel-worksheet-functions/10461-more-than-one-if-statement.html)

heater

More than one IF Statement
 
I want to do the following: IF H8="Yes" then the sum in G8, IF H8="Yes" AND
J8="Yes" then G8 + I8. However, if J8 is blank then it only adds G8.

JEV

=IF(AND(H8="YES",J8="YES"),G8+I8,G8)

I think this should work..will you have answers other than YES and blank?

"heater" wrote:

I want to do the following: IF H8="Yes" then the sum in G8, IF H8="Yes" AND
J8="Yes" then G8 + I8. However, if J8 is blank then it only adds G8.


Jason Morin

One way:

=G8*(H8="yes")+I8*(J8="yes")*(H8="yes")

or a little shorter:

=(H8="yes")*(G8+I8*(J8="yes"))

HTH
Jason
Atlanta, GA

-----Original Message-----
I want to do the following: IF H8="Yes" then the sum in

G8, IF H8="Yes" AND
J8="Yes" then G8 + I8. However, if J8 is blank then it

only adds G8.
.


Jason Morin

This will return the value in G8 if H8 does not
equal "yes".

HTH
Jason
Atlanta, GA

-----Original Message-----
=IF(AND(H8="YES",J8="YES"),G8+I8,G8)

I think this should work..will you have answers other

than YES and blank?

"heater" wrote:

I want to do the following: IF H8="Yes" then the sum

in G8, IF H8="Yes" AND
J8="Yes" then G8 + I8. However, if J8 is blank then

it only adds G8.
.


heater

It worked! Thanks

"JEV" wrote:

=IF(AND(H8="YES",J8="YES"),G8+I8,G8)

I think this should work..will you have answers other than YES and blank?

"heater" wrote:

I want to do the following: IF H8="Yes" then the sum in G8, IF H8="Yes" AND
J8="Yes" then G8 + I8. However, if J8 is blank then it only adds G8.



All times are GMT +1. The time now is 02:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com