Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Bit of a Tricky One

  1. #1
    New Member
    Join Date
    Nov 2012
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Bit of a Tricky One

    Hello,

    I have a bit of a tricky one, maybe. I have formulas in both cells A1 and B1 that will either return a value or be left blank. What I would like to do is create another formula in cell D1 that returns the value of cell C1, but only if either cells A1 or B1 have values in them (not blank). I think I'm close with this formula in cell D1: IF(or(A1>0,B1>0),(C1,"")

  2. #2
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    4,445
    Post Thanks / Like
    Mentioned
    40 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Bit of a Tricky One

    Try

    =IF(OR(A1>0,B1>0),C1,"")
    Regards Dante Amor

  3. #3
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    49,667
    Post Thanks / Like
    Mentioned
    51 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Bit of a Tricky One

    You are close. It is:
    Code:
    =IF(OR(A1>0,B1>0),C1,"")
    (you just had an extra parenthesis)
    Last edited by Joe4; Jun 25th, 2019 at 10:12 AM.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  4. #4
    New Member
    Join Date
    Nov 2012
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Bit of a Tricky One

    There are formulas in A1 and B1 however, that either return a value or remain blank. The formula you gave me works, but even if both the formulas in A1/B1 cells are returning a blank cell D1 is still populating the value in C1. If I delete the formulas out of A1/B1 then D1 becomes empty.

  5. #5
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    49,667
    Post Thanks / Like
    Mentioned
    51 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Bit of a Tricky One

    Are you formulas in A1 and B1 REALLY returning nothing, or are they returning a single space (" ")?
    Can you post the formulas in those cells?

    Maybe try:
    Code:
    IF(OR(LEN(TRIM(A1))>0,LEN(TRIM(B1))>0),C1,"")
    which will ignore blank spaces.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  6. #6
    Board Regular
    Join Date
    Jul 2010
    Posts
    649
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Bit of a Tricky One

    Can u provide what formulas do you have in A1 & B1
    The tragedy of life doesn't lie in not reaching your goal. The tragedy lies in having no goal to reach.

  7. #7
    New Member
    Join Date
    Nov 2012
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Bit of a Tricky One

    A1
    =IF(OR(Input!F103="large-22",Input!F103="large-25.4"),(VLOOKUP(B103,'B:\Menu Database\[BeerDatabase1.xlsx]Sheet1'!$A$3:$AN$40000,40,FALSE)),"")

    B1
    =IF(OR(Input!F103="small-12",Input!F103="small-16.9"),(VLOOKUP(TOAST!B103,'B:\Menu Database\[BeerDatabase1.xlsx]Sheet1'!$A$3:$AO$40000,41,FALSE)),"")

  8. #8
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    49,667
    Post Thanks / Like
    Mentioned
    51 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Bit of a Tricky One

    Did you try the updated formula I provided?
    Did that work?
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  9. #9
    New Member
    Join Date
    Nov 2012
    Posts
    33
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Bit of a Tricky One

    That worked, thank you! Sorry about the delay, too many formulas in my spreadsheet cause it to error out for a bit before coming back up.

  10. #10
    MrExcel MVP
    Junior Admin
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    49,667
    Post Thanks / Like
    Mentioned
    51 Post(s)
    Tagged
    11 Thread(s)

    Default Re: Bit of a Tricky One

    You are welcome.

    Do you ever have instances in which your VLOOKUP does not find what it is looking for and returns an error?
    If so, you should wrap the VLOOKUP in an IFERROR statement, i.e.
    Code:
    =IF(OR(Input!F103="large-22",Input!F103="large-25.4"),IFERROR(VLOOKUP(B103,'B:\Menu Database\[BeerDatabase1.xlsx]Sheet1'!$A$3:$AN$40000,40,FALSE),""),"")
    which return a blank in the event of not finding a match.
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •