+ Reply to Thread
Results 1 to 5 of 5

Return a value if all values in a range are the same.

  1. #1
    Registered User
    Join Date
    02-07-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Return a value if all values in a range are the same.

    Hello,

    Im needing some help with what I think is a relatively simple formula but just cant crack it.

    I have attached a sample sample.xlsx, where everything is explained in a little bit more...

    What I need the formula to do is:


    Cell F2 to return a value of 1 if every single value is column E = 1, otherwise even if there is one 0 in the column the result is to be 0. Also this needs to be reliant on the EmpCode and Bid Preference being the same.


    Many thanks in advance,


    Andrew
    Attached Files Attached Files

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Return a value if all values in a range are the same.

    Using your sample workbook,
    this regular formula, copied down, performs a calculation at each change of EmpCode and returns 1 if all Bid Calculations for that EmpCode = 1
    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Expert
    Join Date
    02-19-2013
    Location
    India
    MS-Off Ver
    07/16
    Posts
    2,386

    Re: Return a value if all values in a range are the same.

    in sample book in sheet1 in F2 copy paste below and drag down
    =IF(SUMPRODUCT(--($A$2:$A$35=A2)*($E$2:$E$35=0))=0,1,0)
    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    WANT TO SAY THANKS, HIT ADD REPUTATION (*) AT THE BOTTOM LEFT CORNER OF THE POST

    More we learn about excel, more it shows us, how less we know about it.

    for chemistry
    https://www.youtube.com/c/chemistrybyshivaansh

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: Return a value if all values in a range are the same.

    Hi and welcome to the forum

    Not sure what the 2nd file is, but based on the 1st upload (sample.xlsx), use this in F2, copied down...
    =COUNTIFS($A$2:$A$35,A2,$E$2:$E$35,"<>1")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Registered User
    Join Date
    02-07-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    18

    Re: Return a value if all values in a range are the same.

    Hi All,

    Thankyou so much for your help.

    This has solved all my problems!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Return value if within range, return multiple values if ranges overlap
    By cde1983 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-17-2013, 06:16 AM
  2. Replies: 4
    Last Post: 05-22-2013, 04:15 AM
  3. Replies: 2
    Last Post: 11-12-2012, 06:26 AM
  4. search a cell for values in a range, return values found
    By carpe.cervisiam in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2011, 12:52 PM
  5. How do I use LOOKUP to return a range of values, then SUM values?
    By irvine79 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-04-2006, 08:35 AM

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