+ Reply to Thread
Results 1 to 15 of 15

Only IF all cells between a range has a certain value.

  1. #1
    Registered User
    Join Date
    08-26-2014
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    13

    Only IF all cells between a range has a certain value.

    Hi just wondering if anyone could help.

    this is my formula i need help with... I'm pretty new at this so any help would be appreciated.

    =IF(COUNTIF(G10:M10,"I")>=1,"I",IF(COUNTIF(G10:M10,"L")>=1,"L",IF(COUNTIF(G10:M10,"U")>=1,"U",IF(COUNTIF(G10:M10,"0")=7,"0",IF(COUNTA(G10:M10,""),"",

    this is the particular line I'm having trouble with

    IF(COUNTIF(G10:M10,"0")=7,"0"

    what I'm trying to do is; if all the cells between G10 & M10 equal 0 then that cell will equal 0..

    i hope that makes sense!!

    thanks in advance

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,469

    Re: Only IF all cells between a range has a certain value.

    "0" is a text string and is not the same as numeric 0 (zero)

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    08-26-2014
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    13

    Re: Only IF all cells between a range has a certain value.

    the 0 is the value I want to be shown. the only way I could do was have the =7 i.e. 7 cells from G to M...

    the cell will change to an ILU0 depending on the value of the 7 cells... but i wanted to have it between a certain range encase someone added or removed a cell.

    does that make sense??

  4. #4
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: Only IF all cells between a range has a certain value.

    A sample workbook without any confidential data showing u r desire results will be helpful to understand u r logic .

    Punnam

  5. #5
    Registered User
    Join Date
    08-26-2014
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    13

    Re: Only IF all cells between a range has a certain value.

    Sample - Copy.xlsm

    please see the blue coloured cells where the formula is...


    so what i would like is if the end user inserts another column it will get counted between the range.

  6. #6
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Only IF all cells between a range has a certain value.

    What if "I", "L" & "U" all >=1 in that range?

    e.g. in row 8: I & L both are >=1
    Last edited by cbatrody; 08-26-2014 at 01:29 AM.

  7. #7
    Registered User
    Join Date
    08-26-2014
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    13

    Re: Only IF all cells between a range has a certain value.

    the values go I to L to U
    The over all level would be equal to the lowest value so I

    only if each level has been entered as a 0 will the Over all level be a 0

  8. #8
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Only IF all cells between a range has a certain value.

    In row 8: 1"I" & 2"L"
    In row 9: 4 "I" & 3"U"

    what is the expected outcome here? and why?


    As per your current formula, when there is an "I" in the range, the outcome will always be "I" no matter how many "U" & "L"s are there in the range.
    Last edited by cbatrody; 08-26-2014 at 01:36 AM.

  9. #9
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Only IF all cells between a range has a certain value.

    May be this.....
    Please Login or Register  to view this content.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  10. #10
    Registered User
    Join Date
    08-26-2014
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    13

    Re: Only IF all cells between a range has a certain value.

    the expected outcome for the overall would be the lowest level which is the I.

    the ILU0 is just represents a different level of understanding...

    "I" being a learner and "0" being a wizard at it.

  11. #11
    Registered User
    Join Date
    08-26-2014
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    13

    Re: Only IF all cells between a range has a certain value.

    Quote Originally Posted by sktneer View Post
    May be this.....
    Please Login or Register  to view this content.
    thanks but the only problem with that is if you delete a 0 the overall level is still at 0 where it would need to be blank if its not all filled as 0

  12. #12
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Only IF all cells between a range has a certain value.

    Try this......

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    08-26-2014
    Location
    Australia
    MS-Off Ver
    2010
    Posts
    13

    Re: Only IF all cells between a range has a certain value.

    Quote Originally Posted by sktneer View Post
    Try this......

    Please Login or Register  to view this content.
    this seems to work! thanks a lot much appreciated!!!

  14. #14
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Only IF all cells between a range has a certain value.

    If I understand correctly this woud be the formula you expected

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Click just below left if it helps, Boo?ath?

  15. #15
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Only IF all cells between a range has a certain value.

    You're welcome.
    If that takes care of your question, please mark your thread as Solved by selecting Thread Tools (just above your first post) --> Mark thread as solved.
    You may also click on * (star) to Add Reputation if the solution provided helped you. This is another way to say thanks to them.

+ 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] Lock/Unlock range cells based on text value in other range cells
    By boboivan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-12-2014, 12:50 PM
  2. [SOLVED] Macro needed to clear cells in range based on value of cells in another range
    By msmith7113 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-05-2013, 12:32 AM
  3. [SOLVED] VBA Copy a range of cells values using the range of cells in a formula (which will change)
    By murtaep in forum Excel Programming / VBA / Macros
    Replies: 32
    Last Post: 06-05-2012, 07:59 AM
  4. Replies: 2
    Last Post: 05-31-2012, 05:37 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