+ Reply to Thread
Results 1 to 7 of 7

If followed by If(AND not working

  1. #1
    Forum Contributor
    Join Date
    01-29-2018
    Location
    United states
    MS-Off Ver
    2019
    Posts
    242

    If followed by If(AND not working

    =IF(D3="",(L26),(D3))
    =IF(AND(D3="",(L26=0)),(J17))

    Please help I can get these 2 statements to work independently but like petulant children wont work together.

    I am trying to get the formula to work like this.
    If D3="" look at L26. If D3="" AND L26=0, look at J17 else do nothing.

    Please let me know.
    I have tried =IF(D3="",(L26),(IF(AND(D3="",(L26=0)),(J17),""))) but it always comes back as 0 regardless if there is a value in L26 or J17

    Thanks
    Brad

  2. #2
    Forum Contributor
    Join Date
    08-26-2016
    Location
    UK
    MS-Off Ver
    O365
    Posts
    260

    Re: If followed by If(AND not working

    =if(d3="",if(l26=0,j17,l26),d3)
    ?

  3. #3
    Forum Contributor
    Join Date
    01-29-2018
    Location
    United states
    MS-Off Ver
    2019
    Posts
    242

    Re: If followed by If(AND not working

    Cheers P45 cal that works! Ive been fighting with that for over 2 hours.

  4. #4
    Forum Contributor
    Join Date
    01-29-2018
    Location
    United states
    MS-Off Ver
    2019
    Posts
    242

    Re: If followed by If(AND not working

    Hey P45 cal ran into a problem with your formula,

    It has to return a value if not zero

    so if A1=0 look at A2, if a2 has a value return that value, if a1 and A2 are blank look at A3 and return that value, if A1, A2, A3 look at A4 and return that value or if all zero do nothing.

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

    Re: If followed by If(AND not working

    Perhaps
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    08-26-2016
    Location
    UK
    MS-Off Ver
    O365
    Posts
    260

    Re: If followed by If(AND not working

    try:
    =INDEX(A1:A22,MATCH(TRUE,$A$1:$A$22<>"",0))
    or:
    =INDEX(A1:A22,MATCH(FALSE,ISBLANK($A$1:$A$22),0))

    Depending on your version of Excel you may have to commit one of these formulae to the sheet using Ctrl+Shift+Enter rather than the more usual plain Enter.

    You can also wrap the whole fornula in IFERROR if all are blank:
    =IFERROR(INDEX(A1:A22,MATCH(TRUE,$A$1:$A$22<>"",0)),"")

    Not sure if the cells are blank or all contain numbers, so it may be:
    =IFERROR(INDEX(A1:A22,MATCH(TRUE,$A$1:$A$22<>0,0)),"")
    It really all depends on what kinds of data are in column A.
    Last edited by p45cal; 12-08-2020 at 09:29 AM.

  7. #7
    Forum Contributor
    Join Date
    08-26-2016
    Location
    UK
    MS-Off Ver
    O365
    Posts
    260

    Re: If followed by If(AND not working

    If your ranges are not contiguous as in your original message, you can do something like:
    =CHOOSE(MATCH(FALSE,CHOOSE({1,2,3},D3,L26,J17)=0,0),D3,L26,J17)
    and put IFERROR around that if you want.

    ps. Do all the testing without IFERROR, making sure you get the right answers and as a final step add the IFERROR.
    Last edited by p45cal; 12-08-2020 at 09:39 AM.

+ 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] If statement on working out percentage and based on time and date not working.
    By Johnny247 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-11-2019, 06:07 PM
  2. Replies: 1
    Last Post: 08-30-2017, 02:32 AM
  3. Replies: 1
    Last Post: 02-27-2016, 06:28 PM
  4. Replies: 3
    Last Post: 05-14-2015, 07:32 AM
  5. Correct/Working (Index,Match) formula not working between cells
    By barnerd in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 02-11-2014, 01:20 PM
  6. Replies: 4
    Last Post: 09-03-2013, 02:52 AM
  7. Replies: 2
    Last Post: 08-17-2012, 08:16 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