Nested IFs?

Redwing2

New Member
Joined
Jan 7, 2015
Messages
10
Hi,
I'm looking for a formula to return TRUE or FALSE if any of the 4 cells in a row verify someone is over the age of 55 based on their Date of Birth. The cells maybe blank which tends to return an error. I used IF(ISNUMBER) to test. Something like this =IF ISNUMBER(F2) IF TRUE then IF Today()-F2/365>55 --If any of the cells are TRUE return TRUE, IF False test the next cell, and so on.

Thanks...
 
Perhaps this?

20 04 13.xlsm
ABCDE
1DOB1DOB2DOB3DOB4Over 55
216-Apr-6511-Apr-8211-Apr-92FALSE
3FALSE
413-Apr-6511-Apr-5011-Apr-92TRUE
Over 55
Cell Formulas
RangeFormula
E2:E4E2=IF(COUNT(A2:D2),MIN(A2:D2)<=EDATE(TODAY(),-660))


Wasn't quite sure if all cells can be blank like row 3 above and, if so, whether you want FALSE or "" returned.
If you want "" in that circumstance, use

=IF(COUNT(A2:D2),MIN(A2:D2)<=EDATE(TODAY(),-660),"")

HI Peter,

I tested the formula and I get incorrect replies
Book1
ABCDEFGHIJ
1First Name#1DOB#1First Name#2DOB#2First Name#3DOB#3First Name#4DOB#4Over 55?
2JohnOctober 29, 1976FALSE
3AliceDecember 17, 1949TomMarch 23, 1956FALSE 70 64 <<should have been TRUE
4PeterFebruary 17, 1955TRUE 65
Sheet1
Cell Formulas
RangeFormula
I2:I4I2=IF(COUNT(B2&D2&F2&H2),MIN(B2&D2&F2&H2)<=EDATE(TODAY(),-660),"")&" "&IF(ISNUMBER(B2),IF((TODAY()-B2)/365>55,INT((TODAY()-B2)/365),""),"") & " " & IF(ISNUMBER(D2),IF((TODAY()-D2)/365>55,INT((TODAY()-D2)/365),""),"") &" "&IF(ISNUMBER(F2),IF((TODAY()-F2)/365>55,INT((TODAY()-F2)/365),""),"") & " "& IF(ISNUMBER(H2),IF((TODAY()-H2)/365>55,INT((TODAY()-H2)/365),""),"")
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Can you post a small sample of your data using the XL2BB button on the reply bar ?
Book1
ABCDEFGHIJ
1First Name#1DOB#1First Name#2DOB#2First Name#3DOB#3First Name#4DOB#4Over 55?
2JohnOctober 29, 1976FALSE
3AliceDecember 17, 1949TomMarch 23, 1956FALSE 70 64 <<should have been TRUE
4PeterFebruary 17, 1955TRUE 65
Sheet1
Cell Formulas
RangeFormula
I2:I4I2=IF(COUNT(B2&D2&F2&H2),MIN(B2&D2&F2&H2)<=EDATE(TODAY(),-660),"")&" "&IF(ISNUMBER(B2),IF((TODAY()-B2)/365>55,INT((TODAY()-B2)/365),""),"") & " " & IF(ISNUMBER(D2),IF((TODAY()-D2)/365>55,INT((TODAY()-D2)/365),""),"") &" "&IF(ISNUMBER(F2),IF((TODAY()-F2)/365>55,INT((TODAY()-F2)/365),""),"") & " "& IF(ISNUMBER(H2),IF((TODAY()-H2)/365>55,INT((TODAY()-H2)/365),""),"")
 
Upvote 0
I didn't have any issues getting Peter's solution to work, at least with our initial assumption about the table structure, meaning four date cells appear in a continuous range. I think my solution will ignore the text and just operate on the dates. Try this in I2 and copy down:
=IFERROR(SMALL(A2:H2,1)<DATE(YEAR(TODAY())-55,MONTH(TODAY()),DAY(TODAY())),"")
 
Upvote 0
I didn't have any issues getting Peter's solution to work, at least with our initial assumption about the table structure, meaning four date cells appear in a continuous range. I think my solution will ignore the text and just operate on the dates. Try this in I2 and copy down:
=IFERROR(SMALL(A2:H2,1)<DATE(YEAR(TODAY())-55,MONTH(TODAY()),DAY(TODAY())),"")
Thanks, KRice. It works. I had issues with this one as well at first but like Peters formula I changed A2:H2 to A2&D2&F2&H2 since the DOB fields in my actual spreadsheet are spread out much further. When I used the formula exactly how you laid it out it worked... thanks again!
 
Upvote 0
You're welcome...I'm glad we arrived at something that works...maybe? I'm not sure about the concatenation of fields. If you are having issues with the cells between dates, try:
=IFERROR(SMALL((B2,D2,F2,H2),1)<DATE(YEAR(TODAY())-55,MONTH(TODAY()),DAY(TODAY())),"")

I got errors when I tried the version with ampersands...I'm assuming you meant B2 rather than A2 in your adjustment to the formula?
 
Upvote 0
HI Peter,

I tested the formula and I get incorrect replies
Book1
ABCDEFGHIJ
1First Name#1DOB#1First Name#2DOB#2First Name#3DOB#3First Name#4DOB#4Over 55?
2JohnOctober 29, 1976FALSE
3AliceDecember 17, 1949TomMarch 23, 1956FALSE 70 64 <<should have been TRUE
4PeterFebruary 17, 1955TRUE 65
Sheet1
Cell Formulas
RangeFormula
I2:I4I2=IF(COUNT(B2&D2&F2&H2),MIN(B2&D2&F2&H2)<=EDATE(TODAY(),-660),"")&" "&IF(ISNUMBER(B2),IF((TODAY()-B2)/365>55,INT((TODAY()-B2)/365),""),"") & " " & IF(ISNUMBER(D2),IF((TODAY()-D2)/365>55,INT((TODAY()-D2)/365),""),"") &" "&IF(ISNUMBER(F2),IF((TODAY()-F2)/365>55,INT((TODAY()-F2)/365),""),"") & " "& IF(ISNUMBER(H2),IF((TODAY()-H2)/365>55,INT((TODAY()-H2)/365),""),"")
That isn't the formula that I posted. The one I posted (adjusted for the extra columns) is shown below. They are the expected results aren't they?

20 04 14.xlsm
ABCDEFGHI
1First Name#1DOB#1First Name#2DOB#2First Name#3DOB#3First Name#4DOB#4Over 55?
2JohnOctober 29, 1976FALSE
3AliceDecember 17, 1949TomMarch 23, 1956TRUE
4PeterFebruary 17, 1955TRUE
Sheet2 (2)
Cell Formulas
RangeFormula
I2:I4I2=IF(COUNT(A2:H2),MIN(A2:H2)<=EDATE(TODAY(),-660))
 
Upvote 0
I noticed that, Peter. Your recommendation works in my sheet, and it is the most efficient. Mine seems to work fine with the extra columns too...I'm not sure what the issue is.
 
Upvote 0

Forum statistics

Threads
1,214,551
Messages
6,120,156
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top