#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default =IF AND or OR

I need some help with a formula. Here's my data:

Field F7 could be 50 or 60 (value)
Field F8 could be either Y or N (meaning yes or no)

If F7=50 and F8=y, then I need it to read "NA" for not applicable
If F7=50 and F8=n, then I need it to read " " blank
If F7=60 and F8=Y, then I need it to perform calculation of F5*F4
If F7=60 and F8=n, then I need it to read " " blank

So, only when F7 is 60 and F8 is Y do I want the formula to calculate. How
do I do this? I've tried =ifand statements and =ifor statements, but they
all keep coming up "false". Please help!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default =IF AND or OR

=IF(F8="n","",IF(F7=50,"NA",F5*F4))

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"sumif and" wrote:

I need some help with a formula. Here's my data:

Field F7 could be 50 or 60 (value)
Field F8 could be either Y or N (meaning yes or no)

If F7=50 and F8=y, then I need it to read "NA" for not applicable
If F7=50 and F8=n, then I need it to read " " blank
If F7=60 and F8=Y, then I need it to perform calculation of F5*F4
If F7=60 and F8=n, then I need it to read " " blank

So, only when F7 is 60 and F8 is Y do I want the formula to calculate. How
do I do this? I've tried =ifand statements and =ifor statements, but they
all keep coming up "false". Please help!

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default =IF AND or OR

On Mon, 5 Jan 2009 12:17:01 -0800, Luke M
wrote:

=IF(F8="n","",IF(F7=50,"NA",F5*F4))



If you want to accept either "n" or "N" as no, you can modify this to

=IF(LOWER(F8)="n","",IF(F7=50,"NA",F5*F4))
or
=IF(LOWER(F8)="n"," ",IF(F7=50,"NA",F5*F4))
if you really want " " and not "" as the "blank" result.

Hope this helps / Lars-Åke

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,722
Default =IF AND or OR

BTW, XL does not actually distinguish between upper and lower case when using
IF formulas.
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Lars-Ã…ke Aspelin" wrote:

On Mon, 5 Jan 2009 12:17:01 -0800, Luke M
wrote:

=IF(F8="n","",IF(F7=50,"NA",F5*F4))



If you want to accept either "n" or "N" as no, you can modify this to

=IF(LOWER(F8)="n","",IF(F7=50,"NA",F5*F4))
or
=IF(LOWER(F8)="n"," ",IF(F7=50,"NA",F5*F4))
if you really want " " and not "" as the "blank" result.

Hope this helps / Lars-Ã…ke


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default =IF AND or OR

On Mon, 5 Jan 2009 12:44:03 -0800, Luke M
wrote:

BTW, XL does not actually distinguish between upper and lower case when using
IF formulas.


You are right. I should have checked that first.
Buy how would one do if one really wanted to distinguish between upper
an lower case? CODE() could be used for single letter strings, but
what about longer strings?

/ Lars-Åke


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,624
Default =IF AND or OR

Check out the EXACT() function.

In article ,
Lars-Åke Aspelin wrote:

On Mon, 5 Jan 2009 12:44:03 -0800, Luke M
wrote:

BTW, XL does not actually distinguish between upper and lower case when
using
IF formulas.


You are right. I should have checked that first.
Buy how would one do if one really wanted to distinguish between upper
an lower case? CODE() could be used for single letter strings, but
what about longer strings?

/ Lars-Åke

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 913
Default =IF AND or OR

On Mon, 05 Jan 2009 20:58:36 GMT, Lars-Åke Aspelin
wrote:

On Mon, 5 Jan 2009 12:44:03 -0800, Luke M
wrote:

BTW, XL does not actually distinguish between upper and lower case when using
IF formulas.


You are right. I should have checked that first.
Buy how would one do if one really wanted to distinguish between upper
an lower case? CODE() could be used for single letter strings, but
what about longer strings?

/ Lars-Åke


I found it. EXACT() is the think to use in that case.

/ Lars-Åke
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,240
Default =IF AND or OR

Lars-Åke Aspelin wrote:
On Mon, 5 Jan 2009 12:44:03 -0800, Luke M
wrote:

BTW, XL does not actually distinguish between upper and lower case when using
IF formulas.


You are right. I should have checked that first.
Buy how would one do if one really wanted to distinguish between upper
an lower case? CODE() could be used for single letter strings, but
what about longer strings?

/ Lars-Åke


You would use FIND() or EXACT().
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default =IF AND or OR


If you really have three status options, why complicate it by trying to
use a y/Y/n? Why not just use a DIFFERENT 3rd flag?

y/n/na or y/n/x


--
JBeaucaire
------------------------------------------------------------------------
JBeaucaire's Profile: http://www.thecodecage.com/forumz/member.php?userid=73
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=46728

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 08:25 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"