+ Reply to Thread
Results 1 to 7 of 7

Can I use IF on text?

  1. #1
    Registered User
    Join Date
    12-06-2012
    Location
    Denver, CO
    MS-Off Ver
    Excel 2007
    Posts
    9

    Can I use IF on text?

    I use IF all the time on numerical things, and typically have it print our 111 if true, and 0 if false.

    But I'm in a situation where I want to "search" an array of alpha text and make a decision, like =IF(D11=B,111,0) and of course you experienced folks know what happens.

    So, not being thoroughly familiar with all the logical functions, and never using alpha text, I don't know how to go about writing a simple function to sort out all the "b's" that might be in my array.

    Can I use "IF"? or should I be trying something else; note....... I'd have perhaps a 1000 rows of data, 20 colums, and want to examine [a row at a time is fine] and then print out a 111 in the 21st column if that row contained a "b".

    thx,

    LarryR

  2. #2
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Can I use IF on text?

    to answer the thread title -yes enclose the text with quotation marks "texthere"


    if you could post a sample workbook with expected outcome maybe we could provide a better solution but i think it's a countif

    =if(countif(range of the row,"B")>0,111,0)
    Last edited by vlady; 12-06-2012 at 09:24 PM.
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  3. #3
    Registered User
    Join Date
    12-06-2012
    Location
    Denver, CO
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Can I use IF on text?

    Great; I've learned something already..... now I have to learn to check for "b" in those 20 columns.... I'm going to go and try that, BUT................. if my request to "test" the array for "b" is input into cell E7, then my amateur self would want to do somehting like this, which is wrong, but I think you can see what I'm trying to accomplish:

    =IF(A10:T10=$E$7, 111,0) and you see, I'm TRYING to say "if there are ANY "b's" in row 10 from Col A to Col T, then print 111, else 0"

    thx,

    LarryR

  4. #4
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Can I use IF on text?

    try

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

  5. #5
    Registered User
    Join Date
    12-06-2012
    Location
    Denver, CO
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Can I use IF on text?

    While I was trying to learn how to post a sample array, you answered it...... it has worked perfectly for a small array, so now I must go and learn what is happening inside those parentheses; I've never used "countif"; I'll study that, too.

    In the meantime, can somebody tell me where to go to learn to post sample spreadsheets?

    And then my final step to this problem will be to write a macro [help me?] to immediatley sort my logical column so all the 0's and 111's are segregated. I know basic sorting, but not good at macros yet.

    And many thanks to you, vlady

    LarryR
    Last edited by jeffreybrown; 12-06-2012 at 10:16 PM. Reason: As per Forum Rule #12, don't quote whole posts unless necessary-- it's just clutter.

  6. #6
    Forum Contributor
    Join Date
    09-11-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2003, Excel 2007, Excel 2013
    Posts
    103

    Re: Can I use IF on text?

    At the bottom of the webpage, it teaches something about VBA.

    http://www.datapigtechnologies.com/AccessMain.htm
    Click * to reward me...
    Thank you...

  7. #7
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Can I use IF on text?

    And to post a sample worksheet.

    When you are in Advanced reply, click on the paperclip to open the upload window.

    View Pic

+ 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