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 » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Help with IF statement



 
 
Thread Tools Display Modes
  #1  
Old November 10th, 2008, 03:51 AM posted to microsoft.public.excel.worksheet.functions
momma2all
external usenet poster
 
Posts: 2
Default Help with IF statement

I am trying create the following statement - however I want the value of the
cell to appear not the cell position:

IF(S5U6,"S5", IF(S5U6, "U6"))

the values in in the cells are dates; hoever, when I enter the statement the
cell populates as S5 or U6 not the date that is formatted in the appropriate
cell.


  #2  
Old November 10th, 2008, 04:13 AM posted to microsoft.public.excel.worksheet.functions
smartin
external usenet poster
 
Posts: 780
Default Help with IF statement

momma2all wrote:
I am trying create the following statement - however I want the value of the
cell to appear not the cell position:

IF(S5U6,"S5", IF(S5U6, "U6"))

the values in in the cells are dates; hoever, when I enter the statement the
cell populates as S5 or U6 not the date that is formatted in the appropriate
cell.


Hi there,

Try removing the quotes:
IF(S5U6,S5,IF(S5U6,U6))

Or even
IF(S5U6,S5,U6)

Or perhaps
MAX(S5,U6)

  #3  
Old November 10th, 2008, 04:13 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Help with IF statement

IF(S5U6,"S5", IF(S5U6, "U6"))

To answer your question:

Remove the quotes:

IF(S5U6,S5,IF(S5U6,U6))

The only time you need quotes is when you have hardcoded text:

=IF(A1="Yes","A1 equals Yes","A1 does not equal Yes")

=IF(A110,"A1 is less than 10","A1 is not less than 10")

Now, there'a "black hole" in your logic! What if S5=U6? You haven't
accounted for that possibility. If S5=U6 then your formula would return
FALSE.

Maybe this is what you want:

=MAX(S5,U6)

--
Biff
Microsoft Excel MVP


"momma2all" wrote in message
...
I am trying create the following statement - however I want the value of
the
cell to appear not the cell position:

IF(S5U6,"S5", IF(S5U6, "U6"))

the values in in the cells are dates; hoever, when I enter the statement
the
cell populates as S5 or U6 not the date that is formatted in the
appropriate
cell.




  #4  
Old November 10th, 2008, 04:34 AM posted to microsoft.public.excel.worksheet.functions
momma2all
external usenet poster
 
Posts: 2
Default Help with IF statement

It never donned on me to use a MAX statement - I guess I have been working
ont his thing too long today! Thanks for all your help!!

"T. Valko" wrote:

IF(S5U6,"S5", IF(S5U6, "U6"))


To answer your question:

Remove the quotes:

IF(S5U6,S5,IF(S5U6,U6))

The only time you need quotes is when you have hardcoded text:

=IF(A1="Yes","A1 equals Yes","A1 does not equal Yes")

=IF(A110,"A1 is less than 10","A1 is not less than 10")

Now, there'a "black hole" in your logic! What if S5=U6? You haven't
accounted for that possibility. If S5=U6 then your formula would return
FALSE.

Maybe this is what you want:

=MAX(S5,U6)

--
Biff
Microsoft Excel MVP


"momma2all" wrote in message
...
I am trying create the following statement - however I want the value of
the
cell to appear not the cell position:

IF(S5U6,"S5", IF(S5U6, "U6"))

the values in in the cells are dates; hoever, when I enter the statement
the
cell populates as S5 or U6 not the date that is formatted in the
appropriate
cell.





  #5  
Old November 10th, 2008, 06:31 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default Help with IF statement

You're welcome. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"momma2all" wrote in message
...
It never donned on me to use a MAX statement - I guess I have been working
ont his thing too long today! Thanks for all your help!!

"T. Valko" wrote:

IF(S5U6,"S5", IF(S5U6, "U6"))


To answer your question:

Remove the quotes:

IF(S5U6,S5,IF(S5U6,U6))

The only time you need quotes is when you have hardcoded text:

=IF(A1="Yes","A1 equals Yes","A1 does not equal Yes")

=IF(A110,"A1 is less than 10","A1 is not less than 10")

Now, there'a "black hole" in your logic! What if S5=U6? You haven't
accounted for that possibility. If S5=U6 then your formula would return
FALSE.

Maybe this is what you want:

=MAX(S5,U6)

--
Biff
Microsoft Excel MVP


"momma2all" wrote in message
...
I am trying create the following statement - however I want the value of
the
cell to appear not the cell position:

IF(S5U6,"S5", IF(S5U6, "U6"))

the values in in the cells are dates; hoever, when I enter the
statement
the
cell populates as S5 or U6 not the date that is formatted in the
appropriate
cell.







 




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 01:33 AM.


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