+ Reply to Thread
Results 1 to 2 of 2

IF statement trying to avoid blanks

  1. #1
    Registered User
    Join Date
    03-31-2016
    Location
    Cardiff, Wales
    MS-Off Ver
    2010
    Posts
    3

    Question IF statement trying to avoid blanks

    Afternoon all,

    This will be a simple one for somebody out there but here goes.

    I have 3 tabs (Summary, sheet 2, sheet 3)

    All three tabs have the same columns in the same order. However, there is only data in the summary tab at the moment.

    Name, Address, Town, Telephone number

    These are the column headings. I want to do an IF statement that returns the rows IF the town matches a criteria.... So so far I have: "=IF('Summary'!$C:$C="Manchester",'Summary'!A2,"")"

    This is bringing back the correct data but when I fill down it is including the blank rows. How can I get it to automatically add in the next row down when a certain town is entered in the summary tab? So each row is filled out with no blanks?

    Thank you!

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

    Re: IF statement trying to avoid blanks

    Try something like this...

    Data Range
    A
    B
    C
    D
    E
    1
    ------
    ------
    ------
    ------
    ------
    2
    Name1
    Town1
    Town1
    Name1
    3
    Name2
    Town3
    Name4
    4
    Name3
    Town2
    Name6
    5
    Name4
    Town1
    6
    Name5
    Town4
    7
    Name6
    Town1
    8
    Name7
    Town2
    9
    Name8
    Town3
    10
    Name9
    Town4


    This array formula** entered in E2:

    =IFERROR(INDEX(A:A,SMALL(IF(B$2:B$10=D$2,ROW(B$2:B$10)),ROWS(E$2:E2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Copy down until you get blanks.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

+ 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] Getting the 1st Non-Blank value - Trying to avoid using IF statement (If possible)
    By dluhut in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-17-2014, 02:55 PM
  2. VBA combo boxes (ignore blanks + avoid duplicates)
    By pbobadilla in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-12-2012, 05:44 PM
  3. nested if statement- trying to avoid but don't know how
    By dumpster1985 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-09-2012, 02:56 AM
  4. Trying to avoid long IF statement.
    By Lukus in forum Excel General
    Replies: 5
    Last Post: 01-06-2010, 11:18 AM
  5. How to avoid plotting blanks as zeroes...
    By solecraft311 in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 10-22-2008, 11:59 AM
  6. Countif and averages avoid blanks
    By padawon in forum Excel General
    Replies: 4
    Last Post: 11-13-2007, 06:08 PM
  7. How to avoid counting blanks in a list
    By Frank in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-03-2005, 09:05 AM

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