+ Reply to Thread
Results 1 to 7 of 7

IF Statement

  1. #1
    Forum Contributor
    Join Date
    06-25-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    114

    IF Statement

    Hi All,

    I am looking for a IF statement by comparing two columns. If Books and GSTN has numbers then given me as OK, if Books has value and GSTN Blank then give as Books, if GSTN has value and Books is blank then GSTN.

    Basically which ever column has value should give me the result if both has values throw as OK

    Attached sample book for reference.

    Thank you
    Attached Files Attached Files

  2. #2
    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
    28,192

    Re: IF Statement

    Try

    =IF($E2="","Books",IF($D2="","GSTN","OK"))
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    06-25-2022
    Location
    Ongole, Andhra Pradesh, India
    MS-Off Ver
    Microsoft Office Home & Student 2019
    Posts
    9

    Re: IF Statement

    =IFERROR(IF(AND(D2>0,E2>0),"OK",IF(AND(D2<=0,E2>0),"GSTN",IF(AND(D2>0,E2<=0),"Books",""))),"")

  4. #4
    Forum Contributor
    Join Date
    06-25-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    114

    Re: IF Statement

    Hi John,

    Wonderful.. Works fantastically. if you dont mind can you help me understand what role does $ play and when to use it..

    Thanks a TON

  5. #5
    Forum Contributor
    Join Date
    06-25-2013
    Location
    India
    MS-Off Ver
    Excel 2016
    Posts
    114

    Re: IF Statement

    Thanks Rama this too works well

  6. #6
    Registered User
    Join Date
    06-25-2022
    Location
    Ongole, Andhra Pradesh, India
    MS-Off Ver
    Microsoft Office Home & Student 2019
    Posts
    9

    Re: IF Statement

    Mr. John in the logic given by you, if both values are '0' then it will show OK. pls check

  7. #7
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: IF Statement

    Administrative Note:

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

+ 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 Multi-Criteria Statement inside a Data Validation List
    By dharvey1978 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-31-2020, 09:10 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