+ Reply to Thread
Results 1 to 4 of 4

A formula that combines the following functions: VLOOKUP, IF, AND

  1. #1
    Registered User
    Join Date
    07-19-2011
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    37

    A formula that combines the following functions: VLOOKUP, IF, AND

    Hello there, thanks for reading.

    I've come across a problem that I get the feeling should be simple but just can't get my head around. All the formulas I have tried so far have brought up the #value error if anything at all.

    Basically I want a formula that automatically inputs a code based on 'marital status'. This would be easily done using a vlookup except for the fact that one of these marital statuses has multiple options. Example: if the marital status reads "Married" the code can very depending on whether it is different gender/same gender. I have gender codes in a separate column.

    For example:

    Status--->Code
    Single---------------->Sin
    Civil P'ship------------>Civ
    Married + MM--------->Mar 1
    Married + FF---------->Mar 1
    Married + MF--------->Mar 2

    Married is, of course, in a separate cell from the gender codes, which is why I've attempted to bring the AND function into the IF statement. However, I’m having no luck.

    The spreadsheet I am designing is already getting pretty big so I wanted to avoid having more columns than necessary. Is it even possible to group this together in one formula?

    This is an example of a formula I have tried but returns the #value error.

    =VLOOKUP(I31,Mapping!$A$1:$C$12,3,FALSE)+IF(AND(I31="Married",AH31="MM"),"MAR 12","")

    Any help with this would be greatly appreciated.

    Thank you for your time
    Last edited by C_P; 07-11-2014 at 05:38 AM.

  2. #2
    Valued Forum Contributor Hawkeye16's Avatar
    Join Date
    02-27-2013
    Location
    Holland
    MS-Off Ver
    ├•┤ Pew Pew
    Posts
    441

    Re: A formula that combines the following functions: VLOOKUP, IF, AND

    Marital status in A, Genders in B you could use the formula (untested)
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Despite the high cost of living, it remains very popular.

    Don't forget to mark threads SOLVED when you get an answer and rep all the geniouses that helped you today!

  3. #3
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: A formula that combines the following functions: VLOOKUP, IF, AND

    Refer attached workbook. Col F contains the required formula. Is this something that you can work with?
    Attached Files Attached Files
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  4. #4
    Registered User
    Join Date
    07-19-2011
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    37

    Re: A formula that combines the following functions: VLOOKUP, IF, AND

    Thank you both for the quick response!

    The index function seems to work perfectly, thank you so much.

    I shall also take a look at the attachment as well, though wil have to do so later at home since my thread now doesn't seem to be loading properly.

    Thank you again

+ 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. [SOLVED] Vlookup Formula that combines two different Look Up values in the same table array
    By ensmith in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-24-2013, 11:05 PM
  2. [SOLVED] Looking for a formula that combines two vlookups
    By ensmith in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 07-24-2013, 12:45 PM
  3. Help Creating a formula that combines a countif statement and a date filter
    By mark.studley in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-14-2013, 04:09 AM
  4. [SOLVED] Formula that combines text cells into single cell paragraph
    By bga10s in forum Excel General
    Replies: 12
    Last Post: 08-02-2012, 04:44 PM
  5. function combines:?:Need Help
    By aatwell19 in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 05-04-2010, 12:22 PM

Tags for this Thread

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