+ Reply to Thread
Results 1 to 8 of 8

My If statement not working

  1. #1
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    My If statement not working

    I have a worksheet with lots of data, and I'm trying to pull out certain rows.



    I made a new sheet to contain all the items I need. Sheet Types has a list of items. And, Spend Data has all my data.

    If column H7445 on spend data has one of the items in Types column C, then put whatever is in column A4112 on Spend Data, etc. etc.

    Here is the formula that has worked on other projects but it's not working now.

    =IF(ISNUMBER(MATCH('Spend Data'!$H7445,Types!$C:$C,0)),INDEX('Spend Data'!A7445,MATCH('Spend Data'!$H7445,Types!$C:$C,0)))

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

    Please Login or Register  to view this content.

    EDIT: Changed Index Sheetname: Should be "Types"
    Last edited by NBVC; 12-03-2007 at 05:18 PM.
    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
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Your INDEX range needs to be a range of cells the same size as the MATCH range, you only have a single cell. Try

    =IF(ISNUMBER(MATCH('Spend Data'!$H7445,Types!$C:$C,0)),INDEX(Types!$A:$A, MATCH('Spend Data'!$H7445,Types!$C:$C,0)),"")

  4. #4
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Still not working

    I tried that statement. I do get data other than #ref, but it's not pulling the correct data.

    I have attached an example of my file.

    You can see that on FIMS sheet on line 4 it looks for Corrosion Inhibitor on Types column C. However, if you look on spend data sheet it pull the wrong data in column B. It should be Wesley, but it's pulling Pennington and the wrong year in column C.

    My goal is if column H is any of the item in Type column C then pull all the information on that row to the FIMS sheet.

  5. #5
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Sorry, I can't get the data under 100mb

    I looks like to me it's finding the first instance of Corrosion inhibitor and pulling that information

  6. #6
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Finally got the file attached

    On the FIMS sheet, you can see that it is pulling the first thing it see.


    Look at row 2, it found H3 in column c of Type(sheet), and even pull the correct information, but it did this for every row. It's not pulling the data over that is associated with that row.

    I need for it to look at Column H and if you find that in column C of Type then pull that whole row over.
    Attached Files Attached Files

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Is this what you're looking for? See attached.
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    08-09-2006
    Posts
    147

    Talking Oh Yes!!! Thank you

    That is exactly what I am looking for. Thank you very much.

+ 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