#1   Report Post  
Posted to microsoft.public.excel.misc
Rob Rob is offline
external usenet poster
 
Posts: 718
Default Countif Problem

I am trying to calculate the total time in one cell, if another cell equals a
certain test.
Example:

A B C D
1 :15 1S
2 1:00 2S
3 :45 3I
4 2:00 1S

So i have a countif formula that counts cell 1C, but where i am having
problems is if 1C equals 1S, then i want it to add cell 1B. And then in that
same cell, it would also see cell C4 and add cell B4 to it.
I hope this make some sense.
Any help would be great!
Thanks
Rob
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Countif Problem

Maybe...

=sumif(c:c,"1s",b:b)
or
=sumif(c:c,c1,b:b)

You may want to look at pivottables. You can get nice summary reports like this
pretty easily.

If you've never used pivottables, here are a few links:

Debra Dalgleish's pictures at Jon Peltier's site:
http://peltiertech.com/Excel/Pivots/pivottables.htm
And Debra's own site:
http://www.contextures.com/xlPivot01.html

John Walkenbach also has some at:
http://j-walk.com/ss/excel/files/general.htm
(look for Tony Gwynn's Hit Database)

Chip Pearson keeps Harald Staff's notes at:
http://www.cpearson.com/excel/pivots.htm

MS has some at (xl2000 and xl2002):
http://office.microsoft.com/downloads/2000/XCrtPiv.aspx
http://office.microsoft.com/assistan...lconPT101.aspx

Rob wrote:

I am trying to calculate the total time in one cell, if another cell equals a
certain test.
Example:

A B C D
1 :15 1S
2 1:00 2S
3 :45 3I
4 2:00 1S

So i have a countif formula that counts cell 1C, but where i am having
problems is if 1C equals 1S, then i want it to add cell 1B. And then in that
same cell, it would also see cell C4 and add cell B4 to it.
I hope this make some sense.
Any help would be great!
Thanks
Rob


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default Countif Problem

Instead of counting, you want to sum.

=SUMIF(C:C,"1S",B:B)
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Rob" wrote:

I am trying to calculate the total time in one cell, if another cell equals a
certain test.
Example:

A B C D
1 :15 1S
2 1:00 2S
3 :45 3I
4 2:00 1S

So i have a countif formula that counts cell 1C, but where i am having
problems is if 1C equals 1S, then i want it to add cell 1B. And then in that
same cell, it would also see cell C4 and add cell B4 to it.
I hope this make some sense.
Any help would be great!
Thanks
Rob

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 106
Default Countif Problem

Try =SUMPRODUCT(--(C1:C4="1S");(B1:B4)) and see if it is what you need

"Rob" wrote:

I am trying to calculate the total time in one cell, if another cell equals a
certain test.
Example:

A B C D
1 :15 1S
2 1:00 2S
3 :45 3I
4 2:00 1S

So i have a countif formula that counts cell 1C, but where i am having
problems is if 1C equals 1S, then i want it to add cell 1B. And then in that
same cell, it would also see cell C4 and add cell B4 to it.
I hope this make some sense.
Any help would be great!
Thanks
Rob

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 506
Default Countif Problem

Paste the below formula in D2 cell
=IF(B2="","",IF(LEFT(B2,1)=":",TIME(0,RIGHT(B2,2), 0),VALUE(B2)))
Place the cursor in D Column cell and Select the D Column by hitting
Cntrl+Spacebar and do Right ClickFormat
CellsNumberCategoryTimeType Select 13:30 and give Ok.
Now copy the D2 cell and paste it to the remaining cells of D Column depends
upon the B Column data.

Paste the below formula in E2 cell
=IF(C2="","",SUMIF(C:C,C2,D:D))
Place the cursor in E Column cell and Select the E Column by hitting
Cntrl+Spacebar and do Right ClickFormat
CellsNumberCategoryTimeType and paste the below format
[h]:mm
and give Ok.
Now copy the E2 cell and paste it to the remaining cells of E Column depends
upon the C Column data.

Remember to Click Yes, if this post helps!

--------------------
(Ms-Exl-Learner)
--------------------


"Rob" wrote:

I am trying to calculate the total time in one cell, if another cell equals a
certain test.
Example:

A B C D
1 :15 1S
2 1:00 2S
3 :45 3I
4 2:00 1S

So i have a countif formula that counts cell 1C, but where i am having
problems is if 1C equals 1S, then i want it to add cell 1B. And then in that
same cell, it would also see cell C4 and add cell B4 to it.
I hope this make some sense.
Any help would be great!
Thanks
Rob



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
Problem with COUNTIF being off by 1 Injury Excel Worksheet Functions 1 October 30th 09 09:23 PM
Countif Problem Lise Excel Discussion (Misc queries) 3 March 10th 09 03:31 AM
Countif Problem Mike Excel Discussion (Misc queries) 3 October 5th 07 06:42 PM
Countif Problem Mark W Excel Worksheet Functions 2 April 21st 06 08:39 PM
COUNTIF / SUM problem RobPot Excel Worksheet Functions 2 July 28th 05 12:21 PM


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