+ Reply to Thread
Results 1 to 2 of 2

IF Function using contains

  1. #1
    Forum Contributor
    Join Date
    05-01-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    822

    IF Function using contains

    Hi,

    I need to put an 'if' formula together that is looking for data that contains a certain number of characters.

    For example, my current formula which doesn't work is ( i think the "1J" & "2J" elements need to include the right of A:A for the last 2 digits.

    =If(A:A="1J","ALM",If(A:A="2J","ALM",If(A:A="A0663J",ALM",if(A:A="J053EJ","ALM","ELM"))))

    Any ideas??

  2. #2
    Forum Expert etaf's Avatar
    Join Date
    10-22-2004
    Location
    Wittering, West Sussex, UK
    MS-Off Ver
    365 (Mac OSX) (16.84 (24041420))
    Posts
    8,789

    Re: IF Function using contains

    it maybe useful to have a sample of the data

    you have A:A - are you looking for the text anywhere in the column
    and the IF is just in 1 cell?

    IF its just the last two digits then a right will help

    IF you want to use this in each row to test that row then you would put

    =IF( OR( A2="A0663J", Right(A2,2)="1J" , Right(A2,2)="2J", A:A="J053EJ") , "ALM","ELM")
    and copy down the rows

    otherwise , you may be able to use a countif() with a wild card to search the entire column and then return a result into just 1 cell

    BUT perhaps you would

    Please upload a sample of your workbook to the forum, Make sure you have removed any private information, remember this is a public forum and so available to anyone
    Would like to see an example of your data and also a manual mock up of the expected results you want to achieve.

    To attach a file to your post,
    click "Go advanced" (next to quick post),
    scroll down until you see "manage Attachments",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.
    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.

+ 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. Replies: 13
    Last Post: 04-08-2014, 05:46 AM
  2. [SOLVED] Using Offset function as the array in the PercentRank function is giving wrong result
    By Bobneil in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-06-2013, 09:29 PM
  3. Replies: 1
    Last Post: 03-21-2012, 11:22 AM
  4. Replies: 2
    Last Post: 03-20-2009, 01:29 PM
  5. [SOLVED] Excel - User Defined Function Error: This function takes no argume
    By BruceInCalgary in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-18-2006, 04:05 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