Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 14
Default Is that possible; More than one Formula

I don't know whay I can't inculde more than one formula in one cell.

DATA-A DATA-B RESULT

1/31/2010 1/31/2010 Valid
2/2/2008 2/2/2008 Expired
6/6/2010 6/6/2010 Enrolled
(Blank) (Blank) Not Enrolled
N/A N/A N/A

If the date is in the future in Column (B) the result will be [Valid].
If the date is in the past in Column (B) the result will be [Expired].
If the Cell in the Column (A)in Future the result will be [Enrolled]
If the Cell in the Column (A) is Blank, the result will be Blank ("").
If the Cell in the Column (A) is the word (N/A), the result will be [N/A].
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 793
Default Is that possible; More than one Formula

You can but with your logic either the first one will be true or the second
one...

If you correct your logic then you will need something like
=IF(B2=TODAY(),"Valid",IF(B2<TODAY(),"Expired",IF (A2=TODAY(),"Enrolled",IF(A2="","",IF(A2="N/A","N/A")))))

"Khalid A. Al-Otaibi" wrote:

I don't know whay I can't inculde more than one formula in one cell.

DATA-A DATA-B RESULT

1/31/2010 1/31/2010 Valid
2/2/2008 2/2/2008 Expired
6/6/2010 6/6/2010 Enrolled
(Blank) (Blank) Not Enrolled
N/A N/A N/A

If the date is in the future in Column (B) the result will be [Valid].
If the date is in the past in Column (B) the result will be [Expired].
If the Cell in the Column (A)in Future the result will be [Enrolled]
If the Cell in the Column (A) is Blank, the result will be Blank ("").
If the Cell in the Column (A) is the word (N/A), the result will be [N/A].

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 905
Default Is that possible; More than one Formula

"Sheeloo" wrote:
=IF(B2=TODAY(),"Valid",IF(B2<TODAY(),"Expired",
IF(A2=TODAY(),"Enrolled",IF(A2="","",IF(A2="N/A","N/A")))))


Since B2 can only be =TODAY or <TODAY, your formula will only return
"Valid" or "Expired".

Moreover, since text=numeric is always true(!), if A2 contains "N/A", your
formula will return "Enrolled".

Finally, if you corrected all that, your formula will return FALSE if A2 is
none of the expected values ("" or "N/A" or a date).


----- original message -----

"Sheeloo" wrote in message
...
You can but with your logic either the first one will be true or the
second
one...

If you correct your logic then you will need something like
=IF(B2=TODAY(),"Valid",IF(B2<TODAY(),"Expired",IF (A2=TODAY(),"Enrolled",IF(A2="","",IF(A2="N/A","N/A")))))

"Khalid A. Al-Otaibi" wrote:

I don't know whay I can't inculde more than one formula in one cell.

DATA-A DATA-B RESULT

1/31/2010 1/31/2010 Valid
2/2/2008 2/2/2008 Expired
6/6/2010 6/6/2010 Enrolled
(Blank) (Blank) Not Enrolled
N/A N/A N/A

If the date is in the future in Column (B) the result will be [Valid].
If the date is in the past in Column (B) the result will be [Expired].
If the Cell in the Column (A)in Future the result will be [Enrolled]
If the Cell in the Column (A) is Blank, the result will be Blank ("").
If the Cell in the Column (A) is the word (N/A), the result will be
[N/A].


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 905
Default Is that possible; More than one Formula

"Khalid A. Al-Otaibi" wrote:
If the date is in the future in Column (B) the result will be [Valid].
If the date is in the past in Column (B) the result will be [Expired].
If the Cell in the Column (A)in Future the result will be [Enrolled]
If the Cell in the Column (A) is Blank, the result will be Blank ("").
If the Cell in the Column (A) is the word (N/A), the result will be [N/A].


Your rules are not mutually exclusive. Note that a date in B can only be in
the future or in the past (assuming today is one or the other, your choice).
So one of your first two conditions will always be true, and you will never
look at A.

I will assume that if A and B are dates, A <= B is expected to be true.
Also, I will assume that your list of is exhaustive; that is, those are the
only expected values, and you are not trying to recognize unexpected values.
In that case, the simplest formulation is:

=if(A2="", "", if(A2="N/A", "N/A", if(A2TODAY(), "Enrolled",
if(B2<=TODAY(), "Expired", "Valid"))))

If you would like to add some error-checking:

=if(and(A2="",B2=""), "", if(and(A2="N/A",B2="N/A"), "N/A",
if(and(isnumber(A2),isnumber(B2),A2<=B2),
if(A2TODAY(), "Enrolled", if(B2<=TODAY(), "Expired", "Valid")),
"ERROR")))

I believe that catches all mistakes except when A2 or B2 contains an Excel
error (e.g. #VALUE or #REF).


----- original message -----

"Khalid A. Al-Otaibi" wrote in
message ...
I don't know whay I can't inculde more than one formula in one cell.

DATA-A DATA-B RESULT

1/31/2010 1/31/2010 Valid
2/2/2008 2/2/2008 Expired
6/6/2010 6/6/2010 Enrolled
(Blank) (Blank) Not Enrolled
N/A N/A N/A

If the date is in the future in Column (B) the result will be [Valid].
If the date is in the past in Column (B) the result will be [Expired].
If the Cell in the Column (A)in Future the result will be [Enrolled]
If the Cell in the Column (A) is Blank, the result will be Blank ("").
If the Cell in the Column (A) is the word (N/A), the result will be [N/A].


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:21 PM.

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

About Us

"It's about Microsoft Excel"