Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
J J is offline
external usenet poster
 
Posts: 2
Default calculating values based on text in other sheets

Hi,

I need to calculate a total, based on the following conditions.

On sheet 2 I need to display a value in a cell totaling the money spent from
a list of values in sheet 1.

I need to ensure that the following criteria are met in performing the
calulation, on sheet 1 I have 2 text fields and a date field.
I need to add together all costs in say column F, where the text in field A
is "Project1", the text in field B is "consumables" and the contents of
Field C (a Date) is not NULL.

I have several text values so I need to filter out only the values I'm
interested in (i.e. Project1, Project2) and (Consumables, Hardware etc). Can
anyone point me in the direction of some code that I could acheive this with
without me having to filter the spreadsheet and manually total it all up.

Regards

Jonathan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default calculating values based on text in other sheets

=sumproduct(--(Sheet1!$A$1:$A$200="Project1"),--(Sheet1!$B$1:$B$200="consumables"),--(Sheet1!$C$1:$C$200<""),Sheet1!$F$1:$F$200)

should do what you want. Change the 200 to include as many rows as you
need. The more you include the slower the calculation will be, so be
conservative. You can not use entire columns (no: Sheet1!A:A="Project1" for
example)

the text string can be replace with cell references to make this more robuts

=sumproduct(--(Sheet1!$A$1:$A$200=F2),--(Sheet1!$B$1:$B$200=G2),--(Sheet1!$C$1:$C$200<""),Sheet1!$F$1:$F$200)

where F2 holds a project name and G2 holds a type.

as an example.
--
Regards,
Tom Ogilvy


"J" wrote:

Hi,

I need to calculate a total, based on the following conditions.

On sheet 2 I need to display a value in a cell totaling the money spent from
a list of values in sheet 1.

I need to ensure that the following criteria are met in performing the
calulation, on sheet 1 I have 2 text fields and a date field.
I need to add together all costs in say column F, where the text in field A
is "Project1", the text in field B is "consumables" and the contents of
Field C (a Date) is not NULL.

I have several text values so I need to filter out only the values I'm
interested in (i.e. Project1, Project2) and (Consumables, Hardware etc). Can
anyone point me in the direction of some code that I could acheive this with
without me having to filter the spreadsheet and manually total it all up.

Regards

Jonathan



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
Calculating text as values in a row Mick Excel Worksheet Functions 3 December 6th 09 02:23 AM
Calculating future values for assets & liabilities based on ror Janna[_2_] Excel Worksheet Functions 2 February 17th 09 07:39 PM
Calculating values based on selection from a drop-down list in Exc Razzamatazz Excel Worksheet Functions 3 July 12th 08 05:11 PM
Calculating values in two columns based on a variable Alex Excel Discussion (Misc queries) 3 January 23rd 07 07:18 PM
Calculating values to column D with formula based on values column A spolk[_2_] Excel Programming 1 April 30th 04 06:29 PM


All times are GMT +1. The time now is 01:53 AM.

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"