+ Reply to Thread
Results 1 to 5 of 5

Searching large number of cells for a cell containing a different value

  1. #1
    Registered User
    Join Date
    03-10-2009
    Location
    Reading, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Searching large number of cells for a cell containing a different value

    I have a number of worksheets each containing 48 columns. There are approximately 1000 rows on each sheet and all cells contain data. E.g.

    Port 0/1:UP Port0/2:UP Port 0/3:DOWN ……
    Port 0/1:UP Port0/2:UP Port 0/3:DOWN ……
    Port 0/1:UP Port0/2:DOWN Port 0/3:DOWN ……
    Port 0/1:UP Port0/2:UP Port 0/3:DOWN ……


    I simply need to know if all cells in a column contain the same value or if they change at any point.

    So I would like to put a formula in the last cell in each column that displays a 1 if all the cells in that column have the word UP (or DOWN but not some of each) in them and a 0 if some of the cells in the column have UP and some have DOWN.

    I feel this should not be as difficult as I am clearly making it and would be most grateful for any help.

    Regards

    ColinB
    Last edited by ColinB; 03-10-2009 at 01:28 PM.

  2. #2
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,445

    Re: Searching large number of cells for a cell containing a different value

    Hi,

    ajust the range B1:B4 to match your data:

    =IF(COUNTA(B1:B4)=COUNTIF(B1:B4,"*UP"),1,IF(COUNTA(B1:B4)=COUNTIF(B1:B4,"*DOWN"),1,0))
    Last edited by sweep; 03-10-2009 at 10:11 AM. Reason: Actually read the OP
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Searching large number of cells for a cell containing a different value

    Try:

    =--(OR(COUNTIF(A1:A4,"*UP*")=ROWS(A1:A4),COUNTIF(A1:A4,"*DOWN*")=ROWS(A1:A4)))

    where A1:A4 is the range in column A you're looking at....then copy to adjacent columns...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    03-10-2009
    Location
    Reading, England
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Searching large number of cells for a cell containing a different value

    Quote Originally Posted by sweep View Post
    Hi,

    ajust the range B1:B4 to match your data:

    =IF(COUNTA(B1:B4)=COUNTIF(B1:B4,"*UP"),1,IF(COUNTA(B1:B4)=COUNTIF(B1:B4,"*DOWN"),1,0))
    Thanks.

    This is just what I needed - and I even understand what its doing.



    ColinB

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Searching large number of cells for a cell containing a different value

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1