Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Conditional Total in a Cell

I am trying to get a sum of a range depending on the response in another cell.
I have many ranges on a spreadsheet I need totals for.

Example:
A1 X A2 6 A3 RN/LVN
B1 X B2 6 B3 CP
C1 X C2 6 C3 RN/LVN

D2: Sum of the range for A2:C2 if A3:C3 'contains' 'RN'
E2: Next Sum: Sum of the range A2:C2 if A3:C3 equals 'CP'
D1: Sum of A2:C2 if A1:B1 = 'X' and A3:C3 'contains' 'RN'
E1: Sum of A2:C2 if A1:B1 = 'X' and A3:C3 equals 'CP'



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Conditional Total in a Cell

=SUMPRODUCT(--(LEFT(A3:C3,2)="RN"),A2:C2)
=SUMPRODUCT(--(LEFT(A3:C3,2)="CP"),A2:C2)
=SUMPRODUCT(--(A1:C1="X"),--(LEFT(A3:C3,2)="RN"),A2:C2)
=SUMPRODUCT(--(A1:C1="X"),--(LEFT(A3:C3,2)="CP"),A2:C2)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"LoriO" wrote in message
...
I am trying to get a sum of a range depending on the response in another

cell.
I have many ranges on a spreadsheet I need totals for.

Example:
A1 X A2 6 A3 RN/LVN
B1 X B2 6 B3 CP
C1 X C2 6 C3 RN/LVN

D2: Sum of the range for A2:C2 if A3:C3 'contains' 'RN'
E2: Next Sum: Sum of the range A2:C2 if A3:C3 equals 'CP'
D1: Sum of A2:C2 if A1:B1 = 'X' and A3:C3 'contains' 'RN'
E1: Sum of A2:C2 if A1:B1 = 'X' and A3:C3 equals 'CP'





  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Conditional Total in a Cell

Thank you very much - this is great - Another lesson learned
I appreciate the quick help

"Bob Phillips" wrote:

=SUMPRODUCT(--(LEFT(A3:C3,2)="RN"),A2:C2)
=SUMPRODUCT(--(LEFT(A3:C3,2)="CP"),A2:C2)
=SUMPRODUCT(--(A1:C1="X"),--(LEFT(A3:C3,2)="RN"),A2:C2)
=SUMPRODUCT(--(A1:C1="X"),--(LEFT(A3:C3,2)="CP"),A2:C2)

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"LoriO" wrote in message
...
I am trying to get a sum of a range depending on the response in another

cell.
I have many ranges on a spreadsheet I need totals for.

Example:
A1 X A2 6 A3 RN/LVN
B1 X B2 6 B3 CP
C1 X C2 6 C3 RN/LVN

D2: Sum of the range for A2:C2 if A3:C3 'contains' 'RN'
E2: Next Sum: Sum of the range A2:C2 if A3:C3 equals 'CP'
D1: Sum of A2:C2 if A1:B1 = 'X' and A3:C3 'contains' 'RN'
E1: Sum of A2:C2 if A1:B1 = 'X' and A3:C3 equals 'CP'






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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent date/scheduling calc needed jct Excel Worksheet Functions 3 February 24th 06 01:36 AM
Pivot table for reporting sales performance Ram Excel Discussion (Misc queries) 2 February 6th 06 10:06 AM
substract cell F from cell H and total into cell I vadarpug Excel Worksheet Functions 1 October 31st 05 12:32 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


All times are GMT +1. The time now is 11:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"