+ Reply to Thread
Results 1 to 7 of 7

IF function in a range of cells

  1. #1
    Registered User
    Join Date
    02-25-2017
    Location
    Rotterdam, Netherlands
    MS-Off Ver
    2013
    Posts
    4

    IF function in a range of cells

    Hi guys,

    I want to ask Excel to give me a value if a condition is met in a range of cells. So for example in cells I7:I9 I have values of 'Car' (I7), 'Truck' (I8) and 'Bike' (I9). The criterium I am looking for is "Truck" which I entered in I:17 so I can change it to whatever other criterium I want. Since in my example I have '30' Trucks, I need Excel to show me this result which should be equal to the J8 and is the middle value of cells in the range J7:J9.

    I tried this formula:

    {=IF(I7:I9=I17,J7:J9,0)}

    For some reason this doesnt work.

    Any ideas?

    Thnx!!

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.92 (24120731))
    Posts
    9,173

    Re: IF function in a range of cells

    what do you want to put in the cell?

    you can use a countif()

    =if(countif(i7:i9,"truck")>0, "in list", "not in list")
    Wayne
    if my assistance has helped, and only if you wish to , there is an "* Add Reputation" on the left hand side - you can add to my reputation here

    If you have a solution to your thread - Please mark your thread solved do the following: >
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF function in a range of cells

    Maybe this...

    =VLOOKUP(I17,I7:J9,2,0)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    02-25-2017
    Location
    Rotterdam, Netherlands
    MS-Off Ver
    2013
    Posts
    4

    Re: IF function in a range of cells

    I tried the Vloopup function; it works amazingly! Thank you so much!

  5. #5
    Registered User
    Join Date
    02-25-2017
    Location
    Rotterdam, Netherlands
    MS-Off Ver
    2013
    Posts
    4

    Re: IF function in a range of cells

    Thanks! Amazing, this has helped alot!

  6. #6
    Registered User
    Join Date
    02-25-2017
    Location
    Rotterdam, Netherlands
    MS-Off Ver
    2013
    Posts
    4

    Re: IF function in a range of cells

    Thanks for helping; i don't want to put in words however but rather refer to cells.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF function in a range of cells

    You're welcome. Thanks for the feedback!

+ 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. Using IF function across a range of cells
    By Dave vd Westhuizen in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 12-20-2016, 09:44 AM
  2. Range of copied cells based on the range of a UDF array function
    By katxt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2016, 08:58 PM
  3. Replies: 6
    Last Post: 04-18-2016, 05:31 PM
  4. [SOLVED] If function with range of cells
    By sanlen in forum Excel General
    Replies: 6
    Last Post: 10-13-2014, 11:37 PM
  5. Replies: 3
    Last Post: 10-25-2012, 05:47 PM
  6. Cells function within a range
    By therealjag in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-16-2009, 07:59 AM
  7. IF function with a range of cells
    By chubbycheese in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-24-2008, 05:20 PM

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