+ Reply to Thread
Results 1 to 5 of 5

If And Or Statement Help

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-04-2013
    Location
    Suffolk, England
    MS-Off Ver
    Office 365
    Posts
    113

    If And Or Statement Help

    Good Afternoon,

    I am in need of some assistance with a formula for the below.

    I need a formula to reproduce the results in the Formula column below

    Part	Loc1	Loc2	Formula
    1	A	1	Both
    2		2	Loc2
    3			BLANK
    4	C		Loc1
    any help is greatly appreciated

    thanks
    ross

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: If And Or Statement Help

    Use:
    Formula: copy to clipboard
    =CHOOSE(COUNTA($B2:$C2)+1,"BLANK",IF($B2="",C$1,B$1),"Both")
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.85 for Mac MS 365
    Posts
    8,513

    Re: If And Or Statement Help

    this should work...
    =IF(AND(B2="",C2=""),"BLANK",IF(AND(B2="",C2<>""),"Loc2",IF(AND(B2<>"",C2<>""),"Both","Loc1")))
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Forum Contributor
    Join Date
    06-04-2013
    Location
    Suffolk, England
    MS-Off Ver
    Office 365
    Posts
    113

    Re: If And Or Statement Help

    Thanks Olly & Sambo Kid!

    Olly, i forgot to mention that i have a VLOOKUp on the cells in columns, my mistake!

    But SamboKid's formula does the trick!

    Thanks Both.

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: If And Or Statement Help

    That's the problem with only sharing text, instead of an actual workbook...

    EDIT: here's an alternative, which works with formulae in B:C;

    Formula: copy to clipboard
    =CHOOSE(COUNTBLANK($B2:$C2)+1,"Both",IF($B2="",$C$1,$B$1),"BLANK")
    Last edited by Olly; 07-23-2019 at 09:46 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 with IF Statement as logical test, and output if false
    By wetbean in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-19-2018, 12:59 PM
  2. [SOLVED] If statement to select data - nested statement - assistance
    By petitesouris in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 06-29-2015, 09:55 PM
  3. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  4. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  5. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  6. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  7. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 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