+ Reply to Thread
Results 1 to 6 of 6

Inserting Text If Other Conditions Are Met

  1. #1
    Registered User
    Join Date
    11-02-2016
    Location
    Here
    MS-Off Ver
    Microsoft Excel: For Mac 2011
    Posts
    16

    Inserting Text If Other Conditions Are Met

    I have received some great help from you guys for this workbook. However I need one more thing done. I can't seem to piece it together using the other formulas I received from you guys.

    What I would like is for example, if any cell in column C on "Sales and Use Tax" contains "John Smith" AND contains either "Weekly Cleaning Service Renewal" OR "Biweekly Cleaning Service Renewal" in column D, I would like it to insert "Yes" into column Q on sheet "Payments - Cleaning Service" in the row that belongs to John Smith. So if he is in row R, insert "Yes" into column Q row R on "Payments - Cleaning Service" IF John Smith is in column C on sheet "Sales and Use Tax" AND either "Weekly Cleaning Service Renewal" OR "Biweekly Cleaning Service Renewal" is in column D.

    Thanks so much in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,199

    Re: Inserting Text If Other Conditions Are Met

    Try

    in Q7

    =IFERROR(IF(MATCH(1,('Sales and Use Tax'!$C$2:$C$1000=$A7)*(('Sales and Use Tax'!$D$2:$D$1000="Weekly Cleaning Service renewal")+('Sales and Use Tax'!$D$2:$D$1000="Biweekly Cleaning Service renewal")),0),"y",""),"")

    Enter with Ctrl+Shift+Enter

    Copy down

  3. #3
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Re: Inserting Text If Other Conditions Are Met

    What about doing it with COUNTIFS.... Put this in Q7 and copy it down...

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


    I think though either way its prone to problems unless you restrict the input values with data validation or drop down lists to select from. You have one there that says "Weekly Cleaning Service Renewal and Pool Filter" for instance, and if anyone slightly miss types something etc... The formula is looking for the specific text so it has to match exactly or the "Y" won't come up.

    Just thought I should point that out.

  4. #4
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Re: Inserting Text If Other Conditions Are Met

    What about doing it with COUNTIFS.... Put this in Q7 and copy it down...

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


    I think though either way its prone to problems unless you restrict the input values with data validation or drop down lists to select from. You have one there that says "Weekly Cleaning Service Renewal and Pool Filter" for instance, and if anyone slightly miss types something etc... The formula is looking for the specific text so it has to match exactly or the "Y" won't come up.

    Just thought I should point that out.

  5. #5
    Forum Contributor
    Join Date
    03-14-2013
    Location
    England
    MS-Off Ver
    2007
    Posts
    186

    Re: Inserting Text If Other Conditions Are Met

    You need to extend the ranges down to however many rows you want to account for by the way, I've only done them for the block of data on the worksheet.

  6. #6
    Registered User
    Join Date
    11-02-2016
    Location
    Here
    MS-Off Ver
    Microsoft Excel: For Mac 2011
    Posts
    16

    Re: Inserting Text If Other Conditions Are Met

    JohnTopley, I tried your formula, but it would only work if I took out either "Weekly..." or "Biweekly..." and had only one in there, but then that takes away function or customers that I service weekly and biweekly.

    D.Lovell, I believe that did the trick. I extended the ranges and specified the cells and tested it with "Weekly..." and "Biweekly..." and tried removing their names and it all functions as wanted!

    Thanks so much for the help everyone! I'll be back if somethign acts fishy!

+ 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: 5
    Last Post: 10-28-2014, 07:51 PM
  2. inserting rows under conditions
    By christopixie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-08-2014, 11:27 PM
  3. Inserting both a cell's value and a text string in a Chart Text Box
    By amberhasaquestion in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-11-2013, 10:49 AM
  4. [SOLVED] inserting cells when conditions not met, overflow error
    By vcorby in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-13-2012, 01:10 PM
  5. When inserting TMs in TEXT mode, all of the text in the cell is changed to the TM color.
    By divakarganta in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-03-2012, 03:12 AM
  6. Replies: 3
    Last Post: 07-11-2012, 06:36 PM
  7. [SOLVED] Text results with two conditions (lookup with two conditions)
    By Davzx in forum Excel General
    Replies: 8
    Last Post: 05-25-2012, 03:08 AM

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