+ Reply to Thread
Results 1 to 9 of 9

AND expressions with text and numbers

  1. #1
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    AND expressions with text and numbers

    Hi

    I'm trying to say that if H2 contains the letters CD and J2 is less than 35000 , then put "EX/EX" , otherwise out M2.

    This is the formula I'm tying , but it's not working :

    =IF(AND(H2="*CD*",J2<35000),"EX/EX",M2)


    It doesn't give an error , but doesn't give correct outcomes either.

    Can anyone suggest a solution? Grateful for your advice.


    Best Wishes ,

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: AND expressions with text and numbers

    Give this a shot:

    =IF(AND(ISNUMBER(SEARCH("CD",H2)),J2<35000),"EX/EX",M2)
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  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: AND expressions with text and numbers

    Are you trying to use wildcards with the *CD* ?

    If so, the AND function doesn't support the use of wildcards.

    Try something like this...

    =IF(AND(COUNT(SEARCH("CD",H2)),J2<35000),"EX/EX",M2)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: AND expressions with text and numbers

    Hi

    Thanks for getting back.

    No joy so far , I'm afraid. I think it may be a formatting issue , but can't be sure..

    The formulas don't have an immediate effect on the existing cell content but do sometimes respond when I enter the data manually.

    It's very puzzling. I can't see why they wouldn't work.

    I've attached a sample of the file as it might clearer that way. Grateful if you have time.

    Best Wishes ,
    Attached Files Attached Files

  5. #5
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: AND expressions with text and numbers

    Looks good to me. Do the formulas work as I've inputted them?
    Attached Files Attached Files

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: AND expressions with text and numbers

    If your sample answers are in column M, then using daffodil's formula gives you the exact same thing
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,946

    Re: AND expressions with text and numbers

    The formulas don't have an immediate effect on the existing cell content
    Do you mean other cells in your worksheet - of teh cells you copied the formulas to?

    Formulas cannot affect other cells, they ONLY affect the cell they are in

  8. #8
    Forum Contributor
    Join Date
    01-18-2013
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    641

    Re: AND expressions with text and numbers

    Hi

    Ok it's looking good now. Thanks for your help! I'm grateful.

    Best Wishes ,

  9. #9
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: AND expressions with text and numbers

    Happy times for everyone! Glad it all worked out!

+ 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. Help needed with expressions with substring expressions.
    By sbell1234 in forum Access Tables & Databases
    Replies: 7
    Last Post: 06-21-2015, 02:59 PM
  2. [SOLVED] Numerical expressions of multiply numbers embedded in text string
    By wraithu in forum Excel General
    Replies: 21
    Last Post: 09-28-2014, 02:19 PM
  3. [SOLVED] Linking two formulas for text conversions to numerical expressions
    By wraithu in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-26-2014, 03:56 PM
  4. [SOLVED] Marco to convert numbers stored as text to numbers and dates stored as text to numbers
    By a2424 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-22-2014, 10:19 AM
  5. Regular Expressions in VBA
    By samualt in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-08-2011, 11:34 PM
  6. Regular Expressions
    By mattdick in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-07-2009, 06:33 PM
  7. [SOLVED] Regular expressions
    By JeffMelton in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-28-2006, 09:00 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