+ Reply to Thread
Results 1 to 6 of 6

Show Values using IF function on Multiple Ranges

  1. #1
    Registered User
    Join Date
    06-24-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    88

    Show Values using IF function on Multiple Ranges

    Hello

    I am trying to use IF function to determine what value should be displayed in a specific column i.e. column H. My table ranges from F5: H201

    I have numeric values in column F, and YES/NO in column G.

    I am trying to achieve following:

    1) If the Value in column F is either 0 or Blank, then column H should display 0.
    2) If column F has a number greater than 0 and column G has "YES" then column H should pick the value from cell F2 in the same sheet.
    3) If column F has a number greater than 0 and column G has "NO" then column H should pick the value from cell I2 in the same sheet.

    I am able to get the parts 2) & 3) working with this formula -

    =IF(ISNUMBER(SEARCH("YES",G5)),$F$2,$I$2)

    or

    =IF(F5<0,0,IF(G5="YES",F2,IF(G5="NO",I2)))

    But I am struggling to get the first condition incorporated in the formula i.e. if the column F is 0 or Blank, then column H should display 0. Only if column F has a number greater than 0, then the 2) or 3) become applicable.

    I would appreciate any help !

    Thanks

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Show Values using IF function on Multiple Ranges

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? Please don't attach a picture of one (no-one will want to re-type all your stuff before starting).

    1. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired solution is also shown (mock up the results manually).

    3. Make sure that all confidential information is removed first!!

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    06-24-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Show Values using IF function on Multiple Ranges

    Hello

    I am attaching a sample sheet.

    I have this formula in column H, where I expect to see a result based on Value in column F and Text in column G

    =IF(F5<0,0,IF(G5="YES",F2,IF(G5="NO",I2)))

    Thanks
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Show Values using IF function on Multiple Ranges

    Is this it??

    =IF(F5<=0,0,IF(G5="YES",$F$2,IF(G5="NO",$I$2)))

  5. #5
    Registered User
    Join Date
    06-24-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Show Values using IF function on Multiple Ranges

    Yes Glenn ..... thats it ! It works like a dream.

    Thanks a lot!

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,063

    Re: Show Values using IF function on Multiple Ranges

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Hide or show multiple named ranges of rows
    By missbogota in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-12-2017, 11:04 AM
  2. Replies: 8
    Last Post: 01-30-2016, 05:00 PM
  3. [SOLVED] Add two Dynamic Named Ranges in userform combobox1. Show values on label1 from combobox se
    By svgopalareddy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2015, 10:54 AM
  4. Return multiple values (Concatenate) values from ranges
    By ghenry0007 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-30-2014, 06:41 PM
  5. Find multiple values in multiple ranges and produce results in a list
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2014, 02:11 AM
  6. Excel 2008 : show multiple values with INDEX function
    By Yannakos in forum Excel General
    Replies: 0
    Last Post: 10-25-2011, 11:13 AM
  7. Replies: 8
    Last Post: 01-07-2011, 07:36 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