Matt Pinkston
asked on
Excel - Getting some calculations with two worksheets
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"
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"
ASKER
how does it know to look in sheet DATA
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,"costc o",Data!B2 :B100)
and
=COUNTIF(Data!A2:A100,"cos tco")
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
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,"costc
and
=COUNTIF(Data!A2:A100,"cos
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
ASKER
this =COUNTIF(Data!A2:A100,"cos tco") works great is the a way to do OR
=COUNTIF(Data!A2:A100,"cos tco" or "walmart" or "kmart")
=COUNTIF(Data!A2:A100,"cos
You can use this version
=SUM(COUNTIF(Data!A2:A100, {"costco", "walmart", "kmart"}))
regards, barry
=SUM(COUNTIF(Data!A2:A100,
regards, barry
ASKER
is there an equivalent or process for =SUMIF(Data!A2:A100,"costc o",Data!B2 :B100)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
AWESOME HELP
=SUMIF(SEGMENT,"costco",CO
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