+ Reply to Thread
Results 1 to 6 of 6

If values in 2 cells matches criteria, add text to a third cell

  1. #1
    Registered User
    Join Date
    10-20-2010
    Location
    Indiana, US
    MS-Off Ver
    Excel 2004
    Posts
    17

    If values in 2 cells matches criteria, add text to a third cell

    Have an issue with client orders. We need to add text to a cell if print orders are over a certain dollar amount and printed on a specific paper.

    So, say cell A1 is photo and cell A2 is 20.00.

    The macro would need to add "XL" to a new cell if A1 = photo and A2 is = or > 20.00.

    Probably simple, but I'm stumped.

  2. #2
    Registered User
    Join Date
    10-31-2011
    Location
    Maryland
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: If values in 2 cells matches criteria, add text to a third cell

    Try this
    = IF(AND(A1="photo",A2>=20),"XL","")

  3. #3
    Registered User
    Join Date
    10-20-2010
    Location
    Indiana, US
    MS-Off Ver
    Excel 2004
    Posts
    17

    Re: If values in 2 cells matches criteria, add text to a third cell

    Thanks. Forgot to mention, this code will need to function within an existing, written macro that reformats the orders. This needs to be a new command line within that macro. Is this format designed for use within a cell in the worksheet?

    We get orders in and run a macro on them to reformat. Sorry if I'm not explaining this well.

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: If values in 2 cells matches criteria, add text to a third cell

    Maybe you can provide the code here and try and help us locate the step where the above formula can be put in.

  5. #5
    Registered User
    Join Date
    10-20-2010
    Location
    Indiana, US
    MS-Off Ver
    Excel 2004
    Posts
    17

    Re: If values in 2 cells matches criteria, add text to a third cell

    I wish I could. But it's considered proprietary intellectual property and I can't post it.

    Thanks for your help though. We'll figure it out.

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: If values in 2 cells matches criteria, add text to a third cell

    Quote Originally Posted by prizm View Post
    Try this
    = IF(AND(A1="photo",A2>=20),"XL","")
    Maybe in the lines of the formula above, if you need to apply it in code you can use the IF loop -

    Please Login or Register  to view this content.
    Just change the cell references where required.

+ 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