Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PCakes
 
Posts: n/a
Default If(and(function help)

I have a worksheet similer to the following with data range names:

User Item Debit
Adam Lunch $1.70
Alex Milk $0.30
Alex Lunch $1.55
Adam Snack $0.50

This is the formula I can't get to compute:
=if(and(user="Adam",item="Lunch"),sum(Debit),""

Any clue as to why it will not work?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
David Billigmeier
 
Posts: n/a
Default If(and(function help)

Close, just re-arrange some formulas. Also have to commit this with
CTRL+SHIFT+ENTER as it is an array formula:

=SUM(IF(((user="Adam")*(item="Lunch")),debit,""))


--
Regards,
Dave


"PCakes" wrote:

I have a worksheet similer to the following with data range names:

User Item Debit
Adam Lunch $1.70
Alex Milk $0.30
Alex Lunch $1.55
Adam Snack $0.50

This is the formula I can't get to compute:
=if(and(user="Adam",item="Lunch"),sum(Debit),""

Any clue as to why it will not work?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
 
Posts: n/a
Default If(and(function help)

Because you want it to evaluate more than one row of data - try it as
an array formula

=sum(if(user="Adam",if(item="Lunch",Debit,0)))

entered as ctrl shift enter to make it an array formula

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PCakes
 
Posts: n/a
Default If(and(function help)

This works wonderfully, I am trying to understand Arrays. Thank you!

"David Billigmeier" wrote:

Close, just re-arrange some formulas. Also have to commit this with
CTRL+SHIFT+ENTER as it is an array formula:

=SUM(IF(((user="Adam")*(item="Lunch")),debit,""))


--
Regards,
Dave


"PCakes" wrote:

I have a worksheet similer to the following with data range names:

User Item Debit
Adam Lunch $1.70
Alex Milk $0.30
Alex Lunch $1.55
Adam Snack $0.50

This is the formula I can't get to compute:
=if(and(user="Adam",item="Lunch"),sum(Debit),""

Any clue as to why it will not work?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
PCakes
 
Posts: n/a
Default If(and(function help)

This also worked very well, thank you for your help.

" wrote:

Because you want it to evaluate more than one row of data - try it as
an array formula

=sum(if(user="Adam",if(item="Lunch",Debit,0)))

entered as ctrl shift enter to make it an array formula


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:03 AM.

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"