# Nested IF equation help?

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

#### dropsofmusic

Hello all you people who know what I'd love to know about excel but don't!

I'm a medical student trying to handle a massive excel database and am way out of my depth. I've just spent the last few hours trying to work some nested IF equations and I'm just not there.

If anyone could help I would hugely appreciate it!

I've essentially got four columns which refer to one individual person

Example

Column A is heart attack (1 = yes)
Column B is age at heart attack (e.g. 56)
Column C is stroke (1=yes)
Column D is age at stroke (e.g. 54)

Basically, I want to Column E to contain information (1=positive result, 0=negative result) on whether that individual had premature cardiovascular disease (heart attack before 55 or stroke before 55).

Some people have had either a heart attack or stroke which means that at any one time column A or C could express a blank value. I need to incorporate something into the formula which controls for this but have so far failed!

Any ideas?

#### dropsofmusic

Wow,

After three hours of plugging I finally ask for help then I think I manage to work it out??

=IF(A1>0,B1<55,IF(C1>0,D1<55))

expresses a true or false result based on whether or not either age of heart attack OR stroke was <55.

I think this is the right formula but if anyone sees something in this that I'm missing let me know - my brain has become a bit boggled with this all!

#### draceplace

Way to Go and figure it out! I improved a little bit on this. With this statement
=IF(AND(A1>0,B1<55),"HT or Stroke",IF(AND(C1>0,D1<55),"Stroke","Neither"))

I would like it to select HT if Stroke is false, and Both if appropriate, but like you...my brain gets boggled.

I have to say Excel is not a database. People try to use it as such but its simply a list, with Excel providing tools to manipulate. If you want a database import/link to access. Excel is well suited for calculation but falls short for programming (which you are on the verge of doing).

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

As Seen On