+ Reply to Thread
Results 1 to 10 of 10

IF function for 2 or more variables

  1. #1
    Registered User
    Join Date
    01-28-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    14

    IF function for 2 or more variables

    I am trying to create a function where fields look for multiple words in a column.

    A5 contains - Texaco B5 contains $20.00 Want J5 to fill in $20.00 automatically
    A9 contains - Shell B9 contains $30.00 " " " $30.00
    A12 contains - Arco B12 contains $26.00 " " " $26.00

    So I want column J, the column for auto expensives to show the amount automatically.

    I am not sure which function to use so appreciate any help.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: IF function for 2 or more variables

    Do you mean?

    =if(a5="Texaco",b5,"")
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    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,929

    Re: IF function for 2 or more variables

    Hi speakbruce and welcome to the forum

    I was going to say, try something like this...

    =if(and(A5="Texaco",B5=20),20,.....
    but I have a question. What if A5=texaco AND A9=Shell? likewise, if B5=20 AND B9=30?
    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

  4. #4
    Registered User
    Join Date
    01-28-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: IF function for 2 or more variables

    What it amounts to is it would be good to have the category columns fill in automatically.

    A lady I work with keeps a spreadsheet with all expenses, so if she goes to Texaco or Shell or ARCO she puts in the dollar value in the first column where all expenses are kept but would like to have the amount auto fill in the column for Auto Expenses.

    And if she goes to Office Depot or Staples to have the amount pop up in the Office Supplies column.

    As soon as I put in the place the money was spent in the withdrawal field, it will pop up in the category fields and save them a step in the accounting.

    Hope this makes sense.

    THANK YOU FOR REPLYING

  5. #5
    Registered User
    Join Date
    01-28-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: IF function for 2 or more variables

    First, thanks for reply.

    Here is what it would look like as I was trying to do it.

    =IF(A5="Texaco" or "Shell" or "ARCO",B5,"") so that it would put the dollar value in the column for Auto.
    A5 = company, B5 = amount spent, J5 = amount filled in in the category menu.

    I have a work around which is to make column A the category (Auto) and then column B the company and then Column K, the Category column which would then populate but I am trying to not have to do this.

    Hope this makes sense.

    Thanks again for help.

  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,929

    Re: IF function for 2 or more variables

    perhaps it would be easier to help you if you uploaded a sample workbook, showing what data you are working with, a few examples of what your expected outcome would be, and how you would arrive at that (remove any confidential info if necessary).
    To attach a file to your post,
    click advanced (next to quick post),
    scroll down until you see "manage file",
    click that and select "add files" (top right corner).
    click "select files" find your file, click "open" click "upload" click 'done" bottom right. click "submit reply"

    Once the upload is completed the file name will appear below the input boxes in this window.
    You can then close the window to return to the new post screen.

  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,929

    Re: IF function for 2 or more variables

    duplicate post self-deleted
    Last edited by FDibbins; 01-29-2013 at 01:00 AM.

  8. #8
    Registered User
    Join Date
    01-28-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: IF function for 2 or more variables

    Here is an example of what I am trying to do.
    Attached Files Attached Files

  9. #9
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: IF function for 2 or more variables

    How does Excel know which categories goes to which. You have to create a lookup table

    example:

    Groceries .....Whole Foods
    Groceries .....Trade Joes's
    Groceries ..... Safeway
    and so on
    do the samething to other categories

  10. #10
    Registered User
    Join Date
    01-28-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: IF function for 2 or more variables

    Thanks.

    This is what I am going to have to do for now.

    Appreciate your help.

+ 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