+ Reply to Thread
Results 1 to 5 of 5

What would be the IF/Then to compare two cells to return one of the cells or the other?

  1. #1
    Registered User
    Join Date
    04-02-2013
    Location
    Kent, wa
    MS-Off Ver
    Excel 2007
    Posts
    17

    What would be the IF/Then to compare two cells to return one of the cells or the other?

    Hello - I need to compare two cells and return one or the other depending on which is greater....

    so formula would be something like 'if A2<B2, then A2. If A2>B2, then B2'

    thank you!!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    04-24-2020
    Location
    Woodbridge, VA
    MS-Off Ver
    2016
    Posts
    434

    Re: What would be the IF/Then to compare two cells to return one of the cells or the other

    Try this in C2 then just copy down.

    =IF(A2<B2,A2,B2)

  3. #3
    Valued Forum Contributor
    Join Date
    04-24-2020
    Location
    Woodbridge, VA
    MS-Off Ver
    2016
    Posts
    434

    Re: What would be the IF/Then to compare two cells to return one of the cells or the other

    FYI - It is actually which is not greater according to your expected result in your sheet.

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: What would be the IF/Then to compare two cells to return one of the cells or the other

    Shorter a little bit:
    =MIN(A2,B2)
    Quang PT

  5. #5
    Registered User
    Join Date
    04-02-2013
    Location
    Kent, wa
    MS-Off Ver
    Excel 2007
    Posts
    17

    Re: What would be the IF/Then to compare two cells to return one of the cells or the other

    Thank you all so much this worked!

+ 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] Compare 3 cells and return various values
    By alanina in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-22-2015, 06:31 AM
  2. [SOLVED] Formula to compare two cells and return the value
    By chinraj in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-19-2014, 08:40 AM
  3. [SOLVED] Compare two cells and return a value to a 3rd cell
    By SIM26 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-29-2014, 01:18 PM
  4. Compare 2 Cells, Return result which is NOT 0
    By louisnhs in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-10-2013, 05:41 AM
  5. Replies: 8
    Last Post: 05-16-2013, 05:28 PM
  6. [SOLVED] Compare 3 cells and return a value (text) when they are in the same row
    By goga in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-02-2013, 06:33 PM
  7. [SOLVED] Compare two cells and return certain value in third cell
    By hurairah in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-19-2006, 02:40 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