Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
RJB RJB is offline
external usenet poster
 
Posts: 86
Default COUNTIF, Sorting, Two Sheets

The RANGE and CRITERIA for my COUNTIF are on two separate tabs of the same
file.

When I set it up, nice.

But if I sort any other field in that column, the CRITERIA refers back to
its ORIGINAL position, and returns in its new cell the count of the data that
occupies the ORIGINAL position.

In other words:

So I have:

A2=COUNTIF(Sheet2!'Range',Sheet1!B2) | B2="Candy"
A3=COUNTIF(Sheet2!'Range',Sheet1!B3) | B3="Dreadlocks"
A4=COUNTIF(Sheet2!'Range',Sheet1!B4) | B4="Bris"
A5=COUNTIF(Sheet2!'Range',Sheet1!B5) | B5="Armistice Day"

Or:
38 Candy
79 Dreadlocks
29 Bris
173 Armistice Day



If I do an alpha sort on column B, I get:


A2=COUNTIF(Sheet2!'Range',Sheet1!B5) | B2="Armistice Day"
A3=COUNTIF(Sheet2!'Range',Sheet1!B4) | B3="Bris"
A4=COUNTIF(Sheet2!'Range',Sheet1!B2) | B4="Candy"
A5=COUNTIF(Sheet2!'Range',Sheet1!B3) | B5="Dreadlocks"

Or:
79 Armistice Day
38 Bris
173 Candy
29 Dreadlocks

See? The first row says, Hey, the criteria for this USED to be in cell B5.
So instead of counting the number of times "Armistice Day" appears in the
sheet, I'll look down and see what's in B5 now - "Dreadlocks". Alright, I'll
count THAT and return that value.

What I'd like is for it to always return the count of the cell next to it.
Because I'd like to sort by the COUNTIF, but I'd also like to sort by other
criteria in the same table.

Help!
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
Countif looking at many sheets Jock Excel Worksheet Functions 7 October 1st 09 05:13 PM
Using COUNTIF across different sheets JStiehl Excel Discussion (Misc queries) 1 May 14th 08 02:17 PM
sorting sheets Tim Twilley New Users to Excel 2 June 28th 07 11:06 PM
Sorting sheets Lp12 Excel Discussion (Misc queries) 3 June 11th 06 05:28 PM
COUNTIF across sheets MaggieMagill Excel Worksheet Functions 2 October 7th 05 08:18 AM


All times are GMT +1. The time now is 02:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"