Solved

Excel - Getting some calculations with two worksheets

Posted on 2011-02-24
8
203 Views
Last Modified: 2012-05-11
I have an excel workbook with two worksheets Data - raw data and Cover which is my cover sheet.

On the cover worksheet I want to have some values inserted by calculation on data in the data sheet.

1. I need a subtotal of the column COST when the column SEGMENT equals a specific value.  That column could have 10 values one being  "coscto" lets say I want cell D7 in cover to equal the sum of COST when SEGMENT = "costco"

2. I would also need D9 in COVER to equal the total number of deals when SEGMENT = "costco"

0
Comment
Question by:Matt Pinkston
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 50

Expert Comment

by:barry houdini
ID: 34970251
You can use SUMIF, i.e. in D7 try this formula

=SUMIF(SEGMENT,"costco",COST)

is the 2nd just a case of counting costco in SEGMENT column? If so use COUNTIF in D9

=COUNTIF(SEGMENT,"costco")

or does "deals" refer to a value in another column?

regards, barry

0
 

Author Comment

by:Matt Pinkston
ID: 34970498
how does it know to look in sheet DATA
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 34970863
Hello pinkstomp,

I assumed that SEGMENT and COST were named ranges in your other sheet in which case their definitions will include the reference to Data worksheet. If you don't have named ranges then you need to refer to the ranges explicitly so if SEGMENT is Data sheet A2:A100 and COST is B2:B100 in that sheet the formulas would be:

=SUMIF(Data!A2:A100,"costco",Data!B2:B100)

and

=COUNTIF(Data!A2:A100,"costco")

If you want to define named ranges and you don't know how to then post back - which Excel version are you using?

regards, barry

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Matt Pinkston
ID: 34971092
this =COUNTIF(Data!A2:A100,"costco") works great is the a way to do OR

=COUNTIF(Data!A2:A100,"costco" or "walmart" or "kmart")
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 34971124
You can use this version

=SUM(COUNTIF(Data!A2:A100,{"costco","walmart","kmart"}))

regards, barry
0
 

Author Comment

by:Matt Pinkston
ID: 34971617
is there an equivalent or process for =SUMIF(Data!A2:A100,"costco",Data!B2:B100)
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 34971721
Yes you can do the same there, replace "costco" with an "array constant" showing the text values to count (or sum) an add a SUM function like this

=SUM(SUMIF(Data!A2:A100,{"costco","walmart","kmart"},Data!B2:B100))

you could even list those on the sheet, e.g. if you had costco in H2, walmart in H3 and kmart in H4 you could use this formula for a combined sum

=SUMPRODUCT(SUMIF(Data!A2:A100,H2:H4,Data!B2:B100))

regards, barry

0
 

Author Closing Comment

by:Matt Pinkston
ID: 34972504
AWESOME HELP
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Compare Excel Spreadsheet. 4 33
Excel Data Validation Help 9 47
Color a cell based on a date in Excel 8 23
how to insert the  calendar comtrol for excel cell 10 23
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question