Multi-Condition Formula


"Excel VBA Help"

 


Play Friv Now - Play Friv Games
Go Back   The Code Cage Forums > Microsoft Topics > Microsoft Excel Forum
Our Info Pages:-
The Code Cage - Microsoft Office help

Notices

Microsoft Excel Forum Members Post questions in this forum if they are related to using Microsoft Excel, this includes Worksheet Functions, Excel VBA Programming, Simple Macro Code & Charting, Excel formula etc.

New Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 1st June 2010, 13:00
Malcolm's Avatar
Malcolm
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default Multi-Condition Formula
     Excel: Functions   


------ Register to get rid of these "In Post" ads! ------

Category: Excel: Functions   

I’m using this formula;
=IF(OR(‘Source Sheet’!C10={“”,”C”, “B”}),’Source Sheet’!B10).
This allows what I enter into the source sheet to also enter into the
destination sheet unless, “C” or “B” are present and then nothing is entered
into the destination sheet. This only leaves two conditions that would allow
data entered into the source sheet to appear in the destination sheet. These
conditions are “S” and “D”. If “S” I would like to have any number entered in
the source sheet to appear in the destination sheet, but if the “D” condition
is entered in the source sheet, I would like the number 2 and only 2 to be
entered in the destination sheet. So, if I have not confused this too much,
my question is; is it possible to keep the initial two false conditions; “C”
and “B” in the formula and add the two true conditions “S” and “D”. I hope
that my explanation is not too confusing. I don’t have a good record of being
either clear or concise.
Thank you,
Malcolm


The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!

  #2  
Old 1st June 2010, 13:18
Bob Phillips's Avatar
Bob Phillips
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default Re: Multi-Condition Formula

------ Register to get rid of these "In Post" ads! ------


Do you mean

=IF(OR('Source Sheet'!C10={"","C","B"}),'Source Sheet'!B10,IF(OR('Source
Sheet'!C10={"","D","S"}),2,""))

--

HTH

Bob

"Malcolm" <Malcolm@discussions.microsoft.com> wrote in message
news:A7B0BADC-AA46-4A74-9994-5E9F557CE535@microsoft.com...
> I'm using this formula;
> =IF(OR('Source Sheet'!C10={"","C", "B"}),'Source Sheet'!B10).
> This allows what I enter into the source sheet to also enter into the
> destination sheet unless, "C" or "B" are present and then nothing is
> entered
> into the destination sheet. This only leaves two conditions that would
> allow
> data entered into the source sheet to appear in the destination sheet.
> These
> conditions are "S" and "D". If "S" I would like to have any number entered
> in
> the source sheet to appear in the destination sheet, but if the "D"
> condition
> is entered in the source sheet, I would like the number 2 and only 2 to be
> entered in the destination sheet. So, if I have not confused this too
> much,
> my question is; is it possible to keep the initial two false conditions;
> "C"
> and "B" in the formula and add the two true conditions "S" and "D". I hope
> that my explanation is not too confusing. I don't have a good record of
> being
> either clear or concise.
> Thank you,
> Malcolm
>




  #3  
Old 1st June 2010, 13:41
Jacob Skaria's Avatar
Jacob Skaria
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default RE: Multi-Condition Formula

------ Register to get rid of these "In Post" ads! ------


Try

=IF(OR(C10={"","C","B"}),B10,IF(ISNUMBER(B10),IF(C10="S",B10,
IF(AND(C10="D",B10=2),2,"")),""))

--
Jacob (MVP - Excel)


"Malcolm" wrote:

> I’m using this formula;
> =IF(OR(‘Source Sheet’!C10={“”,”C”, “B”}),’Source Sheet’!B10).
> This allows what I enter into the source sheet to also enter into the
> destination sheet unless, “C” or “B” are present and then nothing is entered
> into the destination sheet. This only leaves two conditions that would allow
> data entered into the source sheet to appear in the destination sheet. These
> conditions are “S” and “D”. If “S” I would like to have any number entered in
> the source sheet to appear in the destination sheet, but if the “D” condition
> is entered in the source sheet, I would like the number 2 and only 2 to be
> entered in the destination sheet. So, if I have not confused this too much,
> my question is; is it possible to keep the initial two false conditions; “C”
> and “B” in the formula and add the two true conditions “S” and “D”. I hope
> that my explanation is not too confusing. I don’t have a good record of being
> either clear or concise.
> Thank you,
> Malcolm
>


The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!

  #4  
Old 1st June 2010, 16:12
Malcolm's Avatar
Malcolm
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default RE: Multi-Condition Formula

------ Register to get rid of these "In Post" ads! ------


Jacob, Hi,
I entered your formula and it worked except for the last condition “D”. I
was not clear, but if the source sheet (End Bal) in cell C10 is “D” there is
no number in the source sheet (End Bal )C10. That is why I wanted to add the
2 to the destination sheet B10. So, does the “'End Bal'!B10=2) refer to the
source sheet? If so, there is no number there. If I am unclear please let me
know.

=IF(OR('End Bal'!C10={"","C","B"}),'End Bal'!B10,IF(ISNUMBER('End
Bal'!B10),IF('End Bal'!C10="S",'End Bal'!B10,IF(AND('End Bal'!C10="D",'End
Bal'!B10=2),2,"")),""))

Regards,
Malcolm


"Jacob Skaria" wrote:

> Try
>
> =IF(OR(C10={"","C","B"}),B10,IF(ISNUMBER(B10),IF(C10="S",B10,
> IF(AND(C10="D",B10=2),2,"")),""))
>
> --
> Jacob (MVP - Excel)
>
>
> "Malcolm" wrote:
>
> > I’m using this formula;
> > =IF(OR(‘Source Sheet’!C10={“”,”C”, “B”}),’Source Sheet’!B10).
> > This allows what I enter into the source sheet to also enter into the
> > destination sheet unless, “C” or “B” are present and then nothing is entered
> > into the destination sheet. This only leaves two conditions that would allow
> > data entered into the source sheet to appear in the destination sheet. These
> > conditions are “S” and “D”. If “S” I would like to have any number entered in
> > the source sheet to appear in the destination sheet, but if the “D” condition
> > is entered in the source sheet, I would like the number 2 and only 2 to be
> > entered in the destination sheet. So, if I have not confused this too much,
> > my question is; is it possible to keep the initial two false conditions; “C”
> > and “B” in the formula and add the two true conditions “S” and “D”. I hope
> > that my explanation is not too confusing. I don’t have a good record of being
> > either clear or concise.
> > Thank you,
> > Malcolm
> >


  #5  
Old 2nd June 2010, 05:05
Jacob Skaria's Avatar
Jacob Skaria
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default RE: Multi-Condition Formula

------ Register to get rid of these "In Post" ads! ------


Hi Malcolm

From your statement "I would like the number 2 and only 2 to be entered in
the destination sheet." I thought the source sheet will have the value; but
you need that to be returned only if the value is 2...

If that is not the case; then try the below version

=IF(OR('End Bal'!C10={"","C","B"}),'End Bal'!B10,
IF(ISNUMBER('End Bal'!B10),IF('End Bal'!C10="S",'End al'!B10,
IF('End Bal'!C10="D",2,"")),""))

--
Jacob (MVP - Excel)


"Malcolm" wrote:

> Jacob, Hi,
> I entered your formula and it worked except for the last condition “D”. I
> was not clear, but if the source sheet (End Bal) in cell C10 is “D” there is
> no number in the source sheet (End Bal )C10. That is why I wanted to add the
> 2 to the destination sheet B10. So, does the “'End Bal'!B10=2) refer to the
> source sheet? If so, there is no number there. If I am unclear please let me
> know.
>
> =IF(OR('End Bal'!C10={"","C","B"}),'End Bal'!B10,IF(ISNUMBER('End
> Bal'!B10),IF('End Bal'!C10="S",'End Bal'!B10,IF(AND('End Bal'!C10="D",'End
> Bal'!B10=2),2,"")),""))
>
> Regards,
> Malcolm
>
>
> "Jacob Skaria" wrote:
>
> > Try
> >
> > =IF(OR(C10={"","C","B"}),B10,IF(ISNUMBER(B10),IF(C10="S",B10,
> > IF(AND(C10="D",B10=2),2,"")),""))
> >
> > --
> > Jacob (MVP - Excel)
> >
> >
> > "Malcolm" wrote:
> >
> > > I’m using this formula;
> > > =IF(OR(‘Source Sheet’!C10={“”,”C”, “B”}),’Source Sheet’!B10).
> > > This allows what I enter into the source sheet to also enter into the
> > > destination sheet unless, “C” or “B” are present and then nothing is entered
> > > into the destination sheet. This only leaves two conditions that would allow
> > > data entered into the source sheet to appear in the destination sheet. These
> > > conditions are “S” and “D”. If “S” I would like to have any number entered in
> > > the source sheet to appear in the destination sheet, but if the “D” condition
> > > is entered in the source sheet, I would like the number 2 and only 2 to be
> > > entered in the destination sheet. So, if I have not confused this too much,
> > > my question is; is it possible to keep the initial two false conditions; “C”
> > > and “B” in the formula and add the two true conditions “S” and “D”. I hope
> > > that my explanation is not too confusing. I don’t have a good record of being
> > > either clear or concise.
> > > Thank you,
> > > Malcolm
> > >


  #6  
Old 2nd June 2010, 14:28
Malcolm's Avatar
Malcolm
Newsgroup Contributor
 
Posts: n/a
Posts Per Day: 0
My Top Tip Count:
Default RE: Multi-Condition Formula

------ Register to get rid of these "In Post" ads! ------


Jacob, Hi,
My bad again. 'End Bal!'C10="D", 'End Bal'!B10 is an empty cell on the
source sheet. I want 'Close Bal'!C10="D" and 'Close Bal'B10=2 on the
destination sheet. Again my screwup led to to a formula based on my bad
information, my apologies.

Best Regards,
Malcolm

"Jacob Skaria" wrote:

> Hi Malcolm
>
> From your statement "I would like the number 2 and only 2 to be entered in
> the destination sheet." I thought the source sheet will have the value; but
> you need that to be returned only if the value is 2...
>
> If that is not the case; then try the below version
>
> =IF(OR('End Bal'!C10={"","C","B"}),'End Bal'!B10,
> IF(ISNUMBER('End Bal'!B10),IF('End Bal'!C10="S",'End al'!B10,
> IF('End Bal'!C10="D",2,"")),""))
>
> --
> Jacob (MVP - Excel)
>
>
> "Malcolm" wrote:
>
> > Jacob, Hi,
> > I entered your formula and it worked except for the last condition “D”. I
> > was not clear, but if the source sheet (End Bal) in cell C10 is “D” there is
> > no number in the source sheet (End Bal )C10. That is why I wanted to add the
> > 2 to the destination sheet B10. So, does the “'End Bal'!B10=2) refer to the
> > source sheet? If so, there is no number there. If I am unclear please let me
> > know.
> >
> > =IF(OR('End Bal'!C10={"","C","B"}),'End Bal'!B10,IF(ISNUMBER('End
> > Bal'!B10),IF('End Bal'!C10="S",'End Bal'!B10,IF(AND('End Bal'!C10="D",'End
> > Bal'!B10=2),2,"")),""))
> >
> > Regards,
> > Malcolm
> >
> >
> > "Jacob Skaria" wrote:
> >
> > > Try
> > >
> > > =IF(OR(C10={"","C","B"}),B10,IF(ISNUMBER(B10),IF(C10="S",B10,
> > > IF(AND(C10="D",B10=2),2,"")),""))
> > >
> > > --
> > > Jacob (MVP - Excel)
> > >
> > >
> > > "Malcolm" wrote:
> > >
> > > > I’m using this formula;
> > > > =IF(OR(‘Source Sheet’!C10={“”,”C”, “B”}),’Source Sheet’!B10).
> > > > This allows what I enter into the source sheet to also enter into the
> > > > destination sheet unless, “C” or “B” are present and then nothing is entered
> > > > into the destination sheet. This only leaves two conditions that would allow
> > > > data entered into the source sheet to appear in the destination sheet. These
> > > > conditions are “S” and “D”. If “S” I would like to have any number entered in
> > > > the source sheet to appear in the destination sheet, but if the “D” condition
> > > > is entered in the source sheet, I would like the number 2 and only 2 to be
> > > > entered in the destination sheet. So, if I have not confused this too much,
> > > > my question is; is it possible to keep the initial two false conditions; “C”
> > > > and “B” in the formula and add the two true conditions “S” and “D”. I hope
> > > > that my explanation is not too confusing. I don’t have a good record of being
> > > > either clear or concise.
> > > > Thank you,
> > > > Malcolm
> > > >


The Code Cage Advertisment
Advertisement

To stop seeing these ads and get other benefits check This page!

New Reply
The Code Cage at Facebookhe Code Cage at Twitter


Tags
formula, multicondition

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

The Code Cage Affilliates



http://www.thecodecage.com/forumz tested by McAfee Security http://www.thecodecage.com/forumz tested by McAfee Security

All times are GMT +1. The time now is 16:00.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Template-Modifications by TMS
No part of this board, functionality or creatives may be copied or reproduced either in part or full without the express permission of The Code Cage Team.
Copyright ©2008 - , Simon lloyd.
We are not associated with nor employed by Microsoft in any way, we simply provide resources!
All MS office icons are registered trademarks of the application they represent and are used with permission from Microsoft
UA-8135493-1
Cultural Forum | Study at Malaysian University
X vBulletin 3.8.7 Debug Information
  • Page Generation 0.22771 seconds
  • Memory Usage 6,417KB
  • Queries Executed 17 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footerEnd
  • (1)ad_footerStart
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_headerEnd
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_leftcolumn_code
  • (1)ad_navbar_below
  • (3)ad_postbit_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)helpful_answers
  • (1)helpfulanswers_javascript
  • (1)navbar
  • (3)navbar_link
  • (2)navbar_noticebit
  • (41)option
  • (6)post_thanks_box
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (6)post_thanks_postbit_info
  • (6)postbit
  • (6)postbit_ctoptip
  • (6)postbit_wrapper
  • (1)showthread_changepostsowner_link
  • (1)showthread_extra_fields
  • (1)showthread_quickreply_mrgdp
  • (1)showthread_reason_popup
  • (1)spacer_close
  • (1)spacer_open
  • (1)su_form
  • (2)tagbit
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_datastore.php
  • ./includes/class_hook.php
  • ./awcoding/plugins/awc.php
  • ./awcoding/plugins/ds.php
  • ./awcoding/plugins/ss.php
  • ./includes/functions_notice.php
  • ./mobiquo/smartbanner.php
  • ./mobiquo/include/classTTConnection.php
  • ./mobiquo/smartbanner/head.inc.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/vbatags.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php
  • ./includes/functions_misc.php
  • ./includes/functions_prefix.php 

Hooks Called:
  • init_startup
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_check_criteria
  • notices_noticebit
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • helpfulanswers_showthreadorpost
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • helpfulanswers_show_normal
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • error_fetch
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete