+ Reply to Thread
Results 1 to 16 of 16

IF function - need to skip blanks

  1. #1
    Registered User
    Join Date
    05-20-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    IF function - need to skip blanks

    I'm hoping to explain this the right way. I'm working on a spread sheet that has over 30 columns and hundreds of rows. I have a column that shows "yes" if there are additional charges. In another column it shows how much the additional charges are. I'm trying to do an IF function to get this to show up on a blank worksheet (as I need to send this separate data to another department).
    Here is the formula I've tried:
    =IF(AN197="yes",AL197,0) <<as you see I'm not great at this!
    My issue is that there could be 40 blanks before another "yes"... how do I only capture the "yes" data and not all the blank data in between.

    I hope that explains it, if not please let me know!

    Thanks,

    Karee

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,905

    Re: IF function - need to skip blanks

    Have you considered sorting your data on the column containing the blanks and yeses or using the Auto filter and showing only the records with only Yeses.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    05-20-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: IF function - need to skip blanks

    Hi there, yes but as this is a growing chart by the date the items are put in, I can't sort the data for long.
    I need to keep a running tally on another sheet that I can email monthly to another department.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,905

    Re: IF function - need to skip blanks

    What about something like this: http://www.ozgrid.com/forum/showthread.php?t=88159

    Alan

  5. #5
    Registered User
    Join Date
    05-20-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: IF function - need to skip blanks

    Sorry but this is Greek to me can you help me understand what I'm looking for on this link? I'm not very good with this sort of thing!!

    thanks for your patience!

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

    Re: IF function - need to skip blanks

    Try this...

    Please Login or Register  to view this content.
    Data in the range A2:B10.

    Enter this array formula** in D2:

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

    ** 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.

  7. #7
    Registered User
    Join Date
    05-20-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: IF function - need to skip blanks

    Thank you but I can't get that to work. Here is the attachment of a sheet that I would work on.
    AD is the color with the "yes" and AB has the cost for that yes.
    I need to get the columns in red over to sheet 2 but ONLY ones that have a yes.

    Thanks for your help!! This is a BIG pain for me here and would love the help!
    Attached Files Attached Files

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

    Re: IF function - need to skip blanks

    Try this...

    On Sheet2 ...

    A1 = Shipper Name
    B1 = Auto#
    C1 = Add'l Charges

    Enter this array formula** in A2:

    =IFERROR(INDEX(Sheet1!A:A,SMALL(IF(Sheet1!AD$2:AD$15="yes",ROW(Sheet1!AD$2:AD$15)),ROWS(A$2:A2))),"")

    Enter this array formula** in B2:

    =IFERROR(INDEX(Sheet1!O:O,SMALL(IF(Sheet1!AD$2:AD$15="yes",ROW(Sheet1!AD$2:AD$15)),ROWS(B$2:B2))),"")

    Enter this array formula** in C2:

    =IFERROR(INDEX(Sheet1!AB:AB,SMALL(IF(Sheet1!AD$2:AD$15="yes",ROW(Sheet1!AD$2:AD$15)),ROWS(C$2:C2))),"")

    ** 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.

    Select A2:C2 and copy down until you get blanks.

  9. #9
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,905

    Re: IF function - need to skip blanks

    See attached. Auto filter turned on. Column with Yes is filtered.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    05-20-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: IF function - need to skip blanks

    Quote Originally Posted by alansidman View Post
    See attached. Auto filter turned on. Column with Yes is filtered.
    Hi there, as I said I understand how to filter but this is a shared sheet and can not be filtered for long as I need it on a second sheet.
    thanks.

  11. #11
    Registered User
    Join Date
    05-20-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: IF function - need to skip blanks

    Quote Originally Posted by Tony Valko View Post
    Try this...

    On Sheet2 ...

    A1 = Shipper Name
    B1 = Auto#
    C1 = Add'l Charges

    Enter this array formula** in A2:

    =IFERROR(INDEX(Sheet1!A:A,SMALL(IF(Sheet1!AD$2:AD$15="yes",ROW(Sheet1!AD$2:AD$15)),ROWS(A$2:A2))),"")

    Enter this array formula** in B2:

    =IFERROR(INDEX(Sheet1!O:O,SMALL(IF(Sheet1!AD$2:AD$15="yes",ROW(Sheet1!AD$2:AD$15)),ROWS(B$2:B2))),"")

    Enter this array formula** in C2:

    =IFERROR(INDEX(Sheet1!AB:AB,SMALL(IF(Sheet1!AD$2:AD$15="yes",ROW(Sheet1!AD$2:AD$15)),ROWS(C$2:C2))),"")

    ** 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.

    Select A2:C2 and copy down until you get blanks.
    Tony you did a great job!! Thank you!! My issue is now I'm having issue doing it in my real sheet that is ten times this size!!
    I wonder if I could send you another attachment with more items changed to see if you can assist!

    thanks for your help!!

    K

  12. #12
    Registered User
    Join Date
    05-20-2013
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: IF function - need to skip blanks

    Quote Originally Posted by Tony Valko View Post
    Try this...

    On Sheet2 ...

    A1 = Shipper Name
    B1 = Auto#
    C1 = Add'l Charges

    Enter this array formula** in A2:

    =IFERROR(INDEX(Sheet1!A:A,SMALL(IF(Sheet1!AD$2:AD$15="yes",ROW(Sheet1!AD$2:AD$15)),ROWS(A$2:A2))),"")

    Enter this array formula** in B2:

    =IFERROR(INDEX(Sheet1!O:O,SMALL(IF(Sheet1!AD$2:AD$15="yes",ROW(Sheet1!AD$2:AD$15)),ROWS(B$2:B2))),"")

    Enter this array formula** in C2:

    =IFERROR(INDEX(Sheet1!AB:AB,SMALL(IF(Sheet1!AD$2:AD$15="yes",ROW(Sheet1!AD$2:AD$15)),ROWS(C$2:C2))),"")

    ** 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.

    Select A2:C2 and copy down until you get blanks.
    Hi Tony,

    I got it to work!! Thank goodness!
    One thing I noticed though... when I add the charges on a line that was a few weeks ago, it will not auto populate on sheet 2. Any idea how to get that to work? I need to be able to add ones charges that may show up a few weeks later.

    thank you again! You are so smart!!

  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: IF function - need to skip blanks

    It should work as long as the corresponding cell in column AD = Yes.

    Can you post a new sample file where it is not updating. Make sure you mark/show us what isn't updating in the file.

  14. #14
    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 - need to skip blanks

    Quote Originally Posted by kareerox View Post
    Sorry but this is Greek to me can you help me understand what I'm looking for on this link? I'm not very good with this sort of thing!!

    thanks for your patience!
    @ Biff

    You speak very good Greek!
    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.

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

    Re: IF function - need to skip blanks

    I'll take your word for it!

  16. #16
    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 - need to skip blanks

    Certainly!!! ..............

+ 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