+ Reply to Thread
Results 1 to 6 of 6

How to build a specific type of argument for the IF function

  1. #1
    Registered User
    Join Date
    04-12-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2007
    Posts
    10

    How to build a specific type of argument for the IF function

    Hi all,

    I'm currently facing the following problem:

    I have a matrix with one column and 10,000+ lines; all cells contain a text string, which contains the characters "Lx", x being the an integer between 1 and 9 (i.e Line1 = TEXT (L1); Line2 = TEXT2 (L3); Line3 = TEXT3 (L2). and so on).

    What I'm trying to do is simply copy the content of every cell containing ¨"L6" in the cell immediately next to it (the cells are on column B, and I'd like to copy the ones containing "L6" in column A).

    What's the best way to do this? I was thinking of a macro, but I don't know how to insert "contains "L6"" into the argument of the IF function I'd use in that macro.

    Many thanks in advance for your help,
    Bruno

  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,085

    Re: How to build a specific type of argument for the IF function

    copy to where - if column C
    put in C2 and copy down

    IF( A2="L6", B2, "")

  3. #3
    Registered User
    Join Date
    04-12-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: How to build a specific type of argument for the IF function

    but the cells also contain other text strings, not only "L6"; so the argument can't be A2="L6"...

    The cells are like Total Direct Expenses (L6), Total Revenues (L1), and so forth

  4. #4
    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,085

    Re: How to build a specific type of argument for the IF function

    OK
    Can L6 appear in the other text in the string for any reason at all

    try
    =IF(ISERROR(SEARCH("*L6*",A2,1)),"",B2)

  5. #5
    Registered User
    Join Date
    04-12-2013
    Location
    São Paulo, Brazil
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: How to build a specific type of argument for the IF function

    thanks a lot! this solves the problem.

    could you also post how to do it with a macro, though?

    appreciate your help!

  6. #6
    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,085

    Re: How to build a specific type of argument for the IF function

    No , sorry, my macros are from version 97 and thats the last time i used - so very very rusty now - so will wait for another member to reply to that

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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