+ Reply to Thread
Results 1 to 3 of 3

Problems with an IF statement

  1. #1
    Registered User
    Join Date
    08-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Problems with an IF statement

    =IF(G6="Y",IFERROR(VLOOKUP(F6,'[Section Data]Section Data'!$B$6:$E$9,4,0),""),0)

    I have attached my spreadsheet below, in case you don't understand my description.

    I have a sheet called "Staff" and I need the cell V6, in a column called "Parking Fee" to:
    • Find out what section the staff member works in, found on the same row as the Parking Fee data in cell F6
    • Match this value (which could be either management, sales, accounts or manufacture) with the data on sheet "SectionData"
    • Get the parking fee depending on what section the employee works in and display this data in sheet "Staff", cell V6

    However, this data can only be displayed if cell G6 of sheet "Staff" says "Y" (Yes, that employee rents a parking space).

    I hope that made sense. I think an IF statement with a VLOOKUP statement inside it should work, but it isn't.
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Problems with an IF statement

    Section Data has no spaces in your sheetname... should be:

    =IF(G6="Y",IFERROR(VLOOKUP(F6,SectionData!$B$6:$E$9,2,0),""),0)

    and maybe the 2 should be 4 for Parking fee?
    Last edited by NBVC; 08-23-2012 at 07:57 AM. Reason: typo
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    08-20-2012
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Problems with an IF statement

    Thank you! This is the formula I ended up with:
    =IF(G6="Y",VLOOKUP(F6,SectionData!$B$6:$E$9,4,0),0)

+ 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