+ Reply to Thread
Results 1 to 6 of 6

Need Help with IF Formula

Hybrid View

  1. #1
    Registered User
    Join Date
    08-04-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    53

    Need Help with IF Formula

    Hi All,

    I am working on some data need help on the formula.

    In the attached sheet, i have given different Scenarios of my data that I may come across (A1:E10). I have tried using If condition and got the result (A15:E23) but i am facing some issue with them and its not matching with the expected result which i want (A26:E34).

    Please help me with the formula (i might come across any one of the scenario and it will be changing every week).
    Attached Files Attached Files

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,605

    Re: Need Help with IF Formula

    Could you please explain the logic behind this?

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,736

    Re: Need Help with IF Formula

    Try this in B15

    =IFERROR(INDEX(B$2:B$10,SMALL(IF(B$2:B$10<>"",ROW($A$2:$A$10)-ROW($A$2)+1),ROWS($A$1:A1))),"")

    Enter with Ctrl+Shift+Enter

    Copy across and down

  4. #4
    Registered User
    Join Date
    08-04-2013
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Need Help with IF Formula

    Thanks mate, the formula worked perfectly well.

    Could you please explain me the logic behind this index and small function.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    30,736

    Re: Need Help with IF Formula

    =IFERROR(INDEX(B$2:B$10,SMALL(IF(B$2:B$10<>"",ROW($A$2:$A$10)-ROW($A$2)+1),ROWS($A$1:A1))),"")

    The formula in RED finds all the values in the B range that aren't blank and stores the corresponding numbers in an array. (Hence array formula).

    The SMALL function uses the ROWS($A$1:A1) to index through the ROW values i.e finds first, second, third etc row number we have previously stored and thus provides the row number for the INDEX function.

  6. #6
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,407

    Re: Need Help with IF Formula

    I offer a normal formula.
    Formula: copy to clipboard
    =IFERROR(INDEX(B$2:B$10,SMALL(INDEX(ROW(A$1:A$9)*(B$2:B$10="")*10^10+ROW(A$1:A$9),0),ROW(A1))),"")

+ 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. Replies: 11
    Last Post: 06-06-2014, 03:34 PM
  2. how to hide formula in formula box, view lookup result in formula box?
    By vengatvj in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-14-2013, 04:06 PM

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