A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help with if statement



 
 
Thread Tools Display Modes
  #1  
Old November 19th, 2009, 10:11 PM posted to microsoft.public.excel.misc
rew3791
external usenet poster
 
Posts: 7
Default Help with if statement

Ok, I can't quite make this formulat work.
Assume: Column D is Birth Year, Column E is Death Year, Column F is Age at
Death

The basic formula is =E-D (Death Year minus birth year gives me age at death
(F))

What I’m trying to do is if the death year column is blank (E), add 100 to
the birth year (D), then use that number as the E in the basic formula.
Similarly, if the birth year column (D) is blank, subtract 100 from the death
year (E) then use that as D in the =E-D formula.

This is the statement I've tried:
=IF(ISBLANK(E3), (E3=D3+100)), IF(ISBLANK(D3), (D3=E3-100)), E3-D3

Those "=" signs don't look right....I think that's part of it.
Help?! Thank you!!!!!

--
Rachel
  #2  
Old November 19th, 2009, 10:44 PM posted to microsoft.public.excel.misc
T. Valko
external usenet poster
 
Posts: 15,759
Default Help with if statement

Try this...

=IF(COUNT(D3:E3)=2,E3-D3,IF(COUNT(D3:E3),IF(D3="",E3-100,IF(E3="",D3+100,"")),""))

--
Biff
Microsoft Excel MVP


"rew3791" wrote in message
...
Ok, I can't quite make this formulat work.
Assume: Column D is Birth Year, Column E is Death Year, Column F is Age at
Death

The basic formula is =E-D (Death Year minus birth year gives me age at
death
(F))

What I'm trying to do is if the death year column is blank (E), add 100 to
the birth year (D), then use that number as the E in the basic formula.
Similarly, if the birth year column (D) is blank, subtract 100 from the
death
year (E) then use that as D in the =E-D formula.

This is the statement I've tried:
=IF(ISBLANK(E3), (E3=D3+100)), IF(ISBLANK(D3), (D3=E3-100)), E3-D3

Those "=" signs don't look right....I think that's part of it.
Help?! Thank you!!!!!

--
Rachel



  #3  
Old November 20th, 2009, 02:46 PM posted to microsoft.public.excel.misc
rew3791
external usenet poster
 
Posts: 7
Default Help with if statement

I got "True" in each row.


--
Rachel


"T. Valko" wrote:

Try this...

=IF(COUNT(D3:E3)=2,E3-D3,IF(COUNT(D3:E3),IF(D3="",E3-100,IF(E3="",D3+100,"")),""))

--
Biff
Microsoft Excel MVP


"rew3791" wrote in message
...
Ok, I can't quite make this formulat work.
Assume: Column D is Birth Year, Column E is Death Year, Column F is Age at
Death

The basic formula is =E-D (Death Year minus birth year gives me age at
death
(F))

What I'm trying to do is if the death year column is blank (E), add 100 to
the birth year (D), then use that number as the E in the basic formula.
Similarly, if the birth year column (D) is blank, subtract 100 from the
death
year (E) then use that as D in the =E-D formula.

This is the statement I've tried:
=IF(ISBLANK(E3), (E3=D3+100)), IF(ISBLANK(D3), (D3=E3-100)), E3-D3

Those "=" signs don't look right....I think that's part of it.
Help?! Thank you!!!!!

--
Rachel



.

  #4  
Old November 20th, 2009, 02:51 PM posted to microsoft.public.excel.misc
rew3791
external usenet poster
 
Posts: 7
Default Help with if statement

Ignore the last post. I think it's working! Thanks!

--
Rachel


"rew3791" wrote:

I got "True" in each row.


--
Rachel


"T. Valko" wrote:

Try this...

=IF(COUNT(D3:E3)=2,E3-D3,IF(COUNT(D3:E3),IF(D3="",E3-100,IF(E3="",D3+100,"")),""))

--
Biff
Microsoft Excel MVP


"rew3791" wrote in message
...
Ok, I can't quite make this formulat work.
Assume: Column D is Birth Year, Column E is Death Year, Column F is Age at
Death

The basic formula is =E-D (Death Year minus birth year gives me age at
death
(F))

What I'm trying to do is if the death year column is blank (E), add 100 to
the birth year (D), then use that number as the E in the basic formula.
Similarly, if the birth year column (D) is blank, subtract 100 from the
death
year (E) then use that as D in the =E-D formula.

This is the statement I've tried:
=IF(ISBLANK(E3), (E3=D3+100)), IF(ISBLANK(D3), (D3=E3-100)), E3-D3

Those "=" signs don't look right....I think that's part of it.
Help?! Thank you!!!!!

--
Rachel



.

  #5  
Old November 20th, 2009, 05:08 PM posted to microsoft.public.excel.misc
T. Valko
external usenet poster
 
Posts: 15,759
Default Help with if statement

Good deal. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"rew3791" wrote in message
...
Ignore the last post. I think it's working! Thanks!

--
Rachel


"rew3791" wrote:

I got "True" in each row.


--
Rachel


"T. Valko" wrote:

Try this...

=IF(COUNT(D3:E3)=2,E3-D3,IF(COUNT(D3:E3),IF(D3="",E3-100,IF(E3="",D3+100,"")),""))

--
Biff
Microsoft Excel MVP


"rew3791" wrote in message
...
Ok, I can't quite make this formulat work.
Assume: Column D is Birth Year, Column E is Death Year, Column F is
Age at
Death

The basic formula is =E-D (Death Year minus birth year gives me age
at
death
(F))

What I'm trying to do is if the death year column is blank (E), add
100 to
the birth year (D), then use that number as the E in the basic
formula.
Similarly, if the birth year column (D) is blank, subtract 100 from
the
death
year (E) then use that as D in the =E-D formula.

This is the statement I've tried:
=IF(ISBLANK(E3), (E3=D3+100)), IF(ISBLANK(D3), (D3=E3-100)), E3-D3

Those "=" signs don't look right....I think that's part of it.
Help?! Thank you!!!!!

--
Rachel


.



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:24 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.