+ Reply to Thread
Results 1 to 13 of 13

Using if Statements to look up cell data (complicated)

  1. #1
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Using if Statements to look up cell data (complicated)

    Hi all

    I'd like to ask whether this is possible. When I enter my sales data into a sheet it can be 10000 rows long, I want to be able to enter a set number of transactions on a second sheet which then uses a formula to look up what items was sold on said transaction.

    I'm pretty sure it's possible but I'm out of my depth. I've using something like it before which was this statement - =IF($B1566="","",INDEX('RMS Sales'!P:P,MATCH($C1566,'RMS Sales'!$A:$A,0),1))

    I've attached a example sheet whicih hopefully does a lot better job explaining that I am right now.

    Any help is muchio appreciated.

    Many thanks
    Ben

    For-Excel-Forum.xlsx

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Using if Statements to look up cell data (complicated)

    On sheet2, in B2, try this Array Formula. Since this is an Array Formula so you need to confirm it with Ctrl + Shift + Enter instead of just Enter. (i.e. hold down Ctrl+Shift and then press Enter)

    Please Login or Register  to view this content.
    and then drag across until you get blank cells.

    Is this what you want?
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using if Statements to look up cell data (complicated)

    What data are you wanting to extract? The Item Number from column D or the Description from column E?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using if Statements to look up cell data (complicated)

    Since the data is sorted/grouped together you can do it without the array formula.

  5. #5
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Using if Statements to look up cell data (complicated)

    Quote Originally Posted by sktneer View Post
    On sheet2, in B2, try this Array Formula. Since this is an Array Formula so you need to confirm it with Ctrl + Shift + Enter instead of just Enter. (i.e. hold down Ctrl+Shift and then press Enter)

    Please Login or Register  to view this content.
    and then drag across until you get blank cells.

    Is this what you want?
    Hi

    Sorry I wanted the item Description (column E) to be dropped into B2. If there is more than one item then it would populate into C3 and so on.

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Using if Statements to look up cell data (complicated)

    In that case the formula would be like this........

    Please Login or Register  to view this content.
    and then drag across.

    Again an array formula so requires Ctrl + Shfit + Enter.

  7. #7
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Using if Statements to look up cell data (complicated)

    You're amazing thank you sktneer.

    Ben

  8. #8
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,655

    Re: Using if Statements to look up cell data (complicated)

    You're welcome. Thanks for the feedback.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using if Statements to look up cell data (complicated)

    Here's a non-array formula.

    Entered in B2 and copied across until you get blanks:

    =IF(COLUMNS($B2:B2)>COUNTIF(Sheet1!$A$2:$A$23,$A2),"",INDEX(Sheet1!$E$2:$E$23,MATCH($A2,Sheet1!$A$2:$A$23,0)+COLUMNS($B2:B2)-1))

  10. #10
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Using if Statements to look up cell data (complicated)

    Thanks Tony, what's the difference between an array and non array?

    Ben

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using if Statements to look up cell data (complicated)

    It's kind of hard to explain.

    See if this helps:

    http://www.cpearson.com/Excel/ArrayFormulas.aspx

    Based on your application, a non-array formula would be more efficient (faster to calculate).

  12. #12
    Forum Contributor
    Join Date
    07-31-2012
    Location
    Derby, UK
    MS-Off Ver
    Excel 2013
    Posts
    138

    Re: Using if Statements to look up cell data (complicated)

    Hi Tony

    Thanks for the input, much appreciated.

    Ben

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Using if Statements to look up cell data (complicated)

    You're welcome!

+ 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] SUM of data based on names in other cell (more complicated that it sounds)
    By will561 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-19-2014, 08:39 AM
  2. [SOLVED] Help: How to transpose data (Complicated)
    By tearheaven in forum Excel General
    Replies: 3
    Last Post: 10-13-2013, 09:57 PM
  3. Transposing data...bit complicated
    By kilantro in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-03-2011, 03:45 AM
  4. Excel 2007 : Complicated if statements needed
    By excel_help_needed in forum Excel General
    Replies: 3
    Last Post: 08-21-2010, 10:42 AM
  5. Help with managing data. Complicated one!
    By wizard007 in forum Excel General
    Replies: 5
    Last Post: 05-02-2007, 09:11 AM

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