Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Rich NG
 
Posts: n/a
Default Single Function to Analyze Two Columns?

I have a spreadsheet that contains (among other things):
+ codes for car names (1 = Volvo, 2 = Jeep, 3 = Toyota, etc.). These codes
happen to be in Column C. For specific customer-specified reasons, I MUST
use the numeric assignments for car names.
+ codes for car colors (1 = Red, 2 = Blue, 3 = Black, etc.) These codes
happen to be in Column D Again, there is a specific requirement for this.

I know how to count the number of Volvos (=COUNTIF(C:C,"1") and the number
of Red Cars (=COUNTIF(D:D,"1"). This is needed to develop a grid-like table
with these totals in each grid.

QUESTION: How do I count the number of Red Jeeps, Blue Volvos, etc. without
resorting to VBA? I'm hoping that I can use an Excel function to accomplish
this.

Thanks,
Rich
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default Single Function to Analyze Two Columns?

=sumproduct(--(c1:c100=1),--(d1:d100=1))

you can even put this in a data table to generate a grid of makes & colors
(DataTable..)



"Rich NG" wrote:

I have a spreadsheet that contains (among other things):
+ codes for car names (1 = Volvo, 2 = Jeep, 3 = Toyota, etc.). These codes
happen to be in Column C. For specific customer-specified reasons, I MUST
use the numeric assignments for car names.
+ codes for car colors (1 = Red, 2 = Blue, 3 = Black, etc.) These codes
happen to be in Column D Again, there is a specific requirement for this.

I know how to count the number of Volvos (=COUNTIF(C:C,"1") and the number
of Red Cars (=COUNTIF(D:D,"1"). This is needed to develop a grid-like table
with these totals in each grid.

QUESTION: How do I count the number of Red Jeeps, Blue Volvos, etc. without
resorting to VBA? I'm hoping that I can use an Excel function to accomplish
this.

Thanks,
Rich

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chris Marlow
 
Posts: n/a
Default Single Function to Analyze Two Columns?

Hi,

You could try using a SUMPRODUCT Array formula

=SUMPRODUCT(IF($C$2:$C$4=E2,1,0),IF($D$2:$D$4=F2,1 ,0))

I think with this you can't just specify a column - as this does not handle
empty cells well - here I've assumed that we only have 3 rows of data - from
row 2 to row 4. I've assumed E2/F2 contain the required combo of make/color.

Also you need to commit the formula using ctrl-shift-enter as the IF is
using an array.

Regards,

Chris.

--
Chris Marlow
MCSD.NET, Microsoft Office XP Master


"Rich NG" wrote:

I have a spreadsheet that contains (among other things):
+ codes for car names (1 = Volvo, 2 = Jeep, 3 = Toyota, etc.). These codes
happen to be in Column C. For specific customer-specified reasons, I MUST
use the numeric assignments for car names.
+ codes for car colors (1 = Red, 2 = Blue, 3 = Black, etc.) These codes
happen to be in Column D Again, there is a specific requirement for this.

I know how to count the number of Volvos (=COUNTIF(C:C,"1") and the number
of Red Cars (=COUNTIF(D:D,"1"). This is needed to develop a grid-like table
with these totals in each grid.

QUESTION: How do I count the number of Red Jeeps, Blue Volvos, etc. without
resorting to VBA? I'm hoping that I can use an Excel function to accomplish
this.

Thanks,
Rich

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
.csv file Multiple columns of data in single Cell Bin Excel Discussion (Misc queries) 1 March 29th 06 08:48 PM
How do I print a single column of data in two columns on one page Neal Excel Discussion (Misc queries) 1 January 8th 06 11:31 PM
function that returns a list to a single cell AdamMCW Excel Discussion (Misc queries) 2 October 6th 05 09:55 PM
Sum Count of Single Criteria in Multiple Non-Adjacent columns Sam via OfficeKB.com Excel Worksheet Functions 9 July 14th 05 10:01 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM


All times are GMT +1. The time now is 02:17 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"