+ Reply to Thread
Results 1 to 7 of 7

Need an IF formula for if a cell is equal to another cell and that cell contains a value

  1. #1
    Forum Contributor
    Join Date
    01-04-2016
    Location
    Newcastle
    MS-Off Ver
    2016
    Posts
    107

    Red face Need an IF formula for if a cell is equal to another cell and that cell contains a value

    I need an IF formula for if a cell is equal to another cell and that cell contains a value, so for example if my formula was =IF(G3=J3,1,2), how could i change that so it only works when my cells are not blank.
    Last edited by liamfrancis2013; 01-07-2016 at 10:56 AM.

  2. #2
    Forum Expert shukla.ankur281190's Avatar
    Join Date
    05-17-2014
    Location
    Lucknow, India
    MS-Off Ver
    Office 365
    Posts
    3,935

    Re: Need an IF formula for if a cell is equal to another cell and that cell contains a val

    Which is cell is not blank??? can you upload sample spreadsheet with desired result.
    If I helped, Don't forget to add reputation (click on the little star ★ at bottom of this post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)

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

    Re: Need an IF formula for if a cell is equal to another cell and that cell contains a val

    without an answer to Ankur's question, maybe one of these will help...
    =IF(OR(G3="",J3=""),"",IF(G3=J3,1,2)) OR
    =IF(AND(G3="",J3=""),"",IF(G3=J3,1,2))
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need an IF formula for if a cell is equal to another cell and that cell contains a val

    Quote Originally Posted by liamfrancis2013 View Post
    and that cell contains a value
    I assume "value" means number?

    =IF(COUNT(G3,J3)<2,"",IF(G3=J3,1,2))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Need an IF formula for if a cell is equal to another cell and that cell contains a val

    =if(counta(g3,j3)=2,if(g3=j3,1,2),"")
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Forum Contributor
    Join Date
    01-04-2016
    Location
    Newcastle
    MS-Off Ver
    2016
    Posts
    107

    Re: Need an IF formula for if a cell is equal to another cell and that cell contains a val

    Thanks for the replies ended up going for the nested if: =IF(G2=" "," ",IF(G2=L2,1," ")) which solved the problem

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need an IF formula for if a cell is equal to another cell and that cell contains a val

    You're welcome. We appreciate the feedback!

+ 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: 6
    Last Post: 10-03-2014, 12:18 PM
  2. Looking for a formula- if a cell is blank, it is equal to the cell next to it
    By cedricmsmith in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-05-2014, 11:52 AM
  3. FORMULA HELP - If Cell Equal Another Cell, Return value next to that cell
    By scoochUM in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-22-2014, 10:09 PM
  4. Replies: 1
    Last Post: 11-28-2013, 02:16 AM
  5. [SOLVED] how to do "if formula for cell to equal cell when < or = another cell
    By zydecodog in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 08-01-2013, 08:49 AM
  6. Formula to equal next cell below with value if cell below is blank
    By EoghanMBH in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-14-2012, 12:57 AM
  7. Make Cell equal to result of other cell formula
    By Davo in forum Excel General
    Replies: 1
    Last Post: 08-12-2011, 06:57 PM

Tags for this Thread

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