+ Reply to Thread
Results 1 to 7 of 7

If varaible is in list - formula

  1. #1
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    If varaible is in list - formula

    Hi,

    i want to calculate something like here:

    Screenshot_15.png

    So if "Topo1" in a list , do something.
    How can i write this in formula?

    ah sorry there should be If Topo1, Topo2, Topo3 and so on.

    Best,
    Jacek
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,794

    Re: If varaible is in list - formula

    How about this in C3:

    =IF(COUNTIF($H$1:$H$2,B3),"Yes","No")

    then copy down. You could also do it using MATCH:

    =IF(ISNUMBER(MATCH(B3,$H$1:$H$2,0)),"Yes","No")

    Hope this helps.

    Pete

  3. #3
    Forum Expert Roel Jongman's Avatar
    Join Date
    03-28-2015
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    1,483

    Re: If varaible is in list - formula

    Try this formula in cell C3


    Formula: copy to clipboard
    Please Login or Register  to view this content.


    so use a basic vlookup function to find the value. then use a boolean function ISNA to test if a result was found. then use if to show "No" if ISNA finds a #N/A error (no result found)

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: If varaible is in list - formula

    Hi there,

    See if the following User-Defined Function does what you need:

    Please Login or Register  to view this content.
    The highlighted value may be altered to suit your requirements.


    Hope this helps - please let me know how you get on.

    Regards,

    Greg M
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    01-16-2014
    Location
    Poland
    MS-Off Ver
    Excel 2016-365
    Posts
    2,940

    Re: If varaible is in list - formula

    Hi Guys,

    thank you very much!

    I used Pete_UK formula.
    I do not like UDf function on tables because once i had issues with recalculating it all the time from different macros triggered.

    Best,
    Jacek

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,794

    Re: If varaible is in list - formula

    Glad it (or they) worked for you - thanks for the rep.

    Pete

  7. #7
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: If varaible is in list - formula

    Hi again,

    Many thanks for your feedback.

    Glad to hear that things are working correctly for you now.

    Regards,

    Greg M

+ 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] VB Code to pass varaible
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-23-2017, 03:25 PM
  2. Getting a varaible into the macro
    By barrowinfurnace in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-13-2016, 03:59 AM
  3. [SOLVED] Setting worksheet as apublic varaible
    By tonygg9 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-10-2014, 07:28 AM
  4. making actions with a toolbox in a varaible
    By vin1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2011, 04:37 PM
  5. Help PLEASE! SHEET IS A VARAIBLE... My formula don't work!
    By madars in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-09-2011, 04:07 AM
  6. assining a varaible to the value in another sheet.
    By shishi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2005, 06:05 PM
  7. [SOLVED] Use varaible for worsheet name in a formule
    By slm in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2005, 08:05 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