How to add an AND condition in array formula :: MrExcel Message Board



 FAQFAQ
   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   FavoritesFavorites   StatisticsStatistics 
 RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Online StoreOnline Store

MrExcel Message Board Forum Index -> Excel Questions

How to add an AND condition in array formula
Post new topic   Reply to topic
Last Thread | Next Thread  >   Printable version
  Author    Thread

Terry P
Board Master


Joined: 29 Nov 2002
Posts: 158


Status: Offline

 Reply with quote  

How to add an AND condition in array formula

I have a formula
{=SUM(IF(Payments!$I$4:$I$998=B16,IF(Payments!$D$4:$D$998="Restricted",Payments!$E$4:$E$998,0),0))}

but want to add in an AND statement
Payments!$D$4:$D$998="Restricted" AND Payments!$D$4:$D$998=A6
Brain gone dead!
Please help

Post Fri Sep 19, 2003 1:53 pm 
 View user's profile Send private message

Juan Pablo González
MrExcel MVP


Joined: 09 Feb 2002
Posts: 8580
Location: Marion, IL
Flag: Colombia

Status: Offline

 Reply with quote  

Re: How to add an AND condition in array formula

Just curious, how can the same cell (D4:D998) equal two values ("Restricted" and A6) at the same time ?
_________________
Regards,

Juan Pablo González
MrExcel.com Consulting

Read the Articles List and check out our Recommended links and Add-Ins

Post Fri Sep 19, 2003 1:56 pm 
 View user's profile Send private message Visit poster's website

Mark W.
MrExcel MVP


Joined: 11 Feb 2002
Posts: 7146
Location: Austin, Texas USA
Flag: Usa

Status: Offline

 Reply with quote  

Re: How to add an AND condition in array formula

quote:
Originally posted by Terry P:
I have a formula
{=SUM(IF(Payments!$I$4:$I$998=B16,IF(Payments!$D$4:$D$998="Restricted",Payments!$E$4:$E$998,0),0))}

but want to add in an AND statement
Payments!$D$4:$D$998="Restricted" AND Payments!$D$4:$D$998=A6
Brain gone dead!
Please help


Looks like you're using the Conditional Sum Wizard. You could continue to use it...

Post Fri Sep 19, 2003 1:57 pm 
 View user's profile Send private message

Terry P
Board Master


Joined: 29 Nov 2002
Posts: 158


Status: Offline

 Reply with quote  

Re: How to add an AND condition in array formula

Sorry Mark just can't get my head around it


Sorry Juan
Payments!$D$4:$D$998="Restricted" AND Payments!$H$4:$H$998=A6
Brain totally dead!

Thanks both

Post Fri Sep 19, 2003 2:04 pm 
 View user's profile Send private message

Juan Pablo González
MrExcel MVP


Joined: 09 Feb 2002
Posts: 8580
Location: Marion, IL
Flag: Colombia

Status: Offline

 Reply with quote  

Re: How to add an AND condition in array formula

The wizard should give you a version like

{=SUM(IF(Payments!$I$4:$I$998=B16,IF(Payments!$D$4:$D$998="Restricted",IF(Payments!$H$4:$H$998=A6,Payments!$E$4:$E$998,0),0),0))}
_________________
Regards,

Juan Pablo González
MrExcel.com Consulting

Read the Articles List and check out our Recommended links and Add-Ins

Post Fri Sep 19, 2003 2:06 pm 
 View user's profile Send private message Visit poster's website

Mark W.
MrExcel MVP


Joined: 11 Feb 2002
Posts: 7146
Location: Austin, Texas USA
Flag: Usa

Status: Offline

 Reply with quote  

Re: How to add an AND condition in array formula

quote:
Originally posted by Terry P:
Sorry Mark just can't get my head around it


Sorry Juan
Payments!$D$4:$D$998="Restricted" AND Payments!$H$4:$H$998=A6
Brain totally dead!

Thanks both


If the "it" above refers to the Conditional Sum wizard you ought to give it a 2nd look. It takes you by the hand when constructing such formulas.

Post Fri Sep 19, 2003 2:08 pm 
 View user's profile Send private message

Terry P
Board Master


Joined: 29 Nov 2002
Posts: 158


Status: Offline

 Reply with quote  

Re: How to add an AND condition in array formula

I'll give it a go thanks but may be back! Thanks

Post Fri Sep 19, 2003 2:11 pm 
 View user's profile Send private message

Terry P
Board Master


Joined: 29 Nov 2002
Posts: 158


Status: Offline

 Reply with quote  

Re: How to add an AND condition in array formula

Sorry Mark couldn't figure it out.
Apologies

Post Fri Sep 19, 2003 2:43 pm 
 View user's profile Send private message

Mark W.
MrExcel MVP


Joined: 11 Feb 2002
Posts: 7146
Location: Austin, Texas USA
Flag: Usa

Status: Offline

 Reply with quote  

Re: How to add an AND condition in array formula

What's there to "figure out". You simply follow the guide provided by the wizard. Have you not worked with a wizard (i.e., Chart Wizard, Text to Columns Wizard, PivotTable Wizard) before?

Post Fri Sep 19, 2003 2:48 pm 
 View user's profile Send private message

Terry P
Board Master


Joined: 29 Nov 2002
Posts: 158


Status: Offline

 Reply with quote  

Re: How to add an AND condition in array formula

Thanks Juan. I thought I had tried that one but just not on my toes today.

Mark I have used the formula wizard before but only for rudementary formulae.

Thanks both

Post Fri Sep 19, 2003 2:58 pm 
 View user's profile Send private message

Mark W.
MrExcel MVP


Joined: 11 Feb 2002
Posts: 7146
Location: Austin, Texas USA
Flag: Usa

Status: Offline

 Reply with quote  

Re: How to add an AND condition in array formula

quote:
Originally posted by Terry P:
...Mark I have used the formula wizard before but only for rudementary formulae.

Thanks both


The Conditional Sum wizard (and, those listed above) are quite different from the Function Wizard. Those listed above "take you by the hand" with step-by-step, contextual instructions. They're quite helpful for novice user.

Post Fri Sep 19, 2003 3:21 pm 
 View user's profile Send private message
  Display posts from previous:      

MrExcel Message Board Forum Index -> Excel Questions


Forum Jump:
Jump to:  

Post new topic   Reply to topic
Page 1 of 1



Add To Favorites

 


Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Powered by phpBB: 2.0.4 © 2001 phpBB Group

Need help posting your first question? Read how to post

Need extra help ? Couldn't get the answer you needed ? Get a free quote from our Consulting Team

Download Colo's HTML Maker utility for displaying your Excel Worksheet on the board.

Download VB HTML Maker to post your code on the board


Check out our new index to 485 Excel Articles.


Return to MrExcel Consulting

All contents Copyright 1998-2004 by MrExcel.com
If you believe information posted here is from your copyrighted source, notify us per the Terms of Use
Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.