+ Reply to Thread
Results 1 to 6 of 6

If column text(3 columns) meets criteria then input value in cell

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2007
    Posts
    38

    If column text(3 columns) meets criteria then input value in cell

    Hi All,

    This site has been generous with me thus far and I will see if my luck continues.
    In columns B,C and D I have text.

    For example: Column B header is appetizer, column c is main , and column d is desert.
    There are set menus so when a certain combination is entered I would like Column E to output the price.
    EI: soup, fish, pie = 18
    soup, lamb, cake =20
    salad fish, cake = 17

    I have read a lot on the subject but cant seem to wrap my head around it in vba.
    I am thinking it is an if, and, else statement but am not sure anymore.
    The list would also be dynamic so I would need the code to search and formulate till last empty row.

    Any guidance would be great

    Thanks in advance!

  2. #2
    Registered User
    Join Date
    06-26-2015
    Location
    Poland
    MS-Off Ver
    365
    Posts
    56

    Re: If column text(3 columns) meets criteria then input value in cell

    Hey, if you could set a constant price for each meal, for example soup = 6, fish = 7, pie = 5 then you could use a simple vlookup function for finding price and sum a total price. Something like in attachement:
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    03-19-2013
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: If column text(3 columns) meets criteria then input value in cell

    Hi, Thanks Pojzon for the speedy reply.
    Unfortunately I cant fix the items individually they would need to be grouped. As well as in a macro. I originally used a countif and sorted individually, then entered manually , but it takes too long, especially when if comes to charting.

    Thanks for the effort though
    It is appreciated.

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: If column text(3 columns) meets criteria then input value in cell

    Hi baggypants,

    Have a look at the attached non VBA solution where the amount in column D of the Input tab is simply looked up from the Combinations tab. This has the advantage of being easier to maintain and can be populated (updated) by any user.

    The Combination tab is where you'd input all of the menu combinations so that the amount can be returned to column D of the Input tab. If a combination cannot be found a zero is returned. You may even consider having drop-down in columns A to C of the Input tab so there's no issues around data input error.

    HTH

    Robert
    Attached Files Attached Files
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  5. #5
    Registered User
    Join Date
    03-19-2013
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: If column text(3 columns) meets criteria then input value in cell

    Thanks Trebor76,
    At first I wasn't too sure about it being non-VBA as most of the spreadsheet is but the more I think about it, the more I am convinced this may be a better way to go. I imagine the code would get quite wordy with a possible 50 combinations. The combinations worked great by the way. I was playing around with the simple "=and" at the beginning and just thought if I could get it to read the value instead of true it would be great, and this does just that.

    Thank-you all.

  6. #6
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,523

    Re: If column text(3 columns) meets criteria then input value in cell

    You're welcome

    If you could mark the thread as Solved it would be appreciated

    Thanks,

    Robert

+ 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. Copy text from one sheet to another if one cell meets criteria
    By dptiedtke in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-11-2014, 06:20 AM
  2. Need one column total if criteria meets another columns criteria
    By jebrown in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-24-2013, 08:47 PM
  3. Help! Reference a cell in same column if Range meets criteria
    By Trevorrow in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-12-2013, 03:31 PM
  4. [SOLVED] If range meets criteria then display text in another cell
    By NSimp216 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-05-2013, 05:25 PM
  5. Print specific rows/columns IF a cell meets criteria
    By tiannaleft in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-16-2012, 08:51 AM
  6. Trying to count every second cell in a column that meets certain criteria
    By RalphCr in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-08-2012, 08:40 AM
  7. Insert Column on criteria of text input to cell
    By rickd909 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-07-2007, 05:29 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