+ Reply to Thread
Results 1 to 7 of 7

Need formula to compare multiple cells

  1. #1
    Registered User
    Join Date
    03-08-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    16

    Need formula to compare multiple cells

    Hi, I have a little experience with Excel but im stumped with this even after googling. I need a formula that does the following.

    Formula Cell is located in A1

    Cells H1, H2 & H3 will have either a true or false value. If one of them is true I need A1 to return a text string as listed below. Note only one of the H cells could have a true value.

    H1 if true A1 would be abc (if false no text)
    H2 if true A1 would be def (if false no text)
    H3 if true A1 would be ghi (if false no text)

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Need formula to compare multiple cells

    welcome to the forum. try:
    =INDEX({"abc","def","ghi"},MATCH(TRUE,H1:J1,0))

    if possible to have no TRUEs, then:
    =IFERROR(INDEX({"abc","def","ghi"},MATCH(TRUE,H1:J1,0)),"")

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    03-08-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    16

    Re: Need formula to compare multiple cells

    Thanks but that returned an error. And it is possible for the H cells to be all false. Question regarding the formula the cells are H why the J1?

  4. #4
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Need formula to compare multiple cells

    sorry ranged the wrong cells. i have uploaded an example.
    =IFERROR(INDEX({"abc","def","ghi"},MATCH(TRUE,H1:H3,0)),"")

    next time though, do upload an excel sample so that we do not have to manually key in your data to do a testing.

    input the desired results so that we don't have to second-guess if what we are doing is correct or not. you may look at my signature to upload an eg that is easier to understand.

    the upload attachment must be done by going to Go Advanced. click on Manage Attachments. Choose file, upload and close the window.

    if i really guessed it wrongly, please upload something according to my recommendations. try to use the solution i have given and we'll help to advise what went wrong.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-08-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    16

    Re: Need formula to compare multiple cells

    That still returned an error. Hopefully I followed the upload instructions correctly. Appreciate the help.
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,570

    Re: Need formula to compare multiple cells

    In the case of your file the true's and false's are text strings as opposed to Boolean values which would have displayed in all capital letters in cells H1:H3
    Modify Ben's formula accordingly: =IFERROR(INDEX({"abc","def","ghi"},MATCH("true",H1:H3,0)),"")
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    03-07-2018
    Location
    Berlin
    MS-Off Ver
    2016
    Posts
    4

    Re: Need formula to compare multiple cells

    Îf you want to get rid of the three intermediate cells you can do it all in one formula:
    =INDEX({"abc","def","ghi"},SUM($J$3>=0,$J$3>25000,$J$3>50000))

    If you want to account for negative values as well:
    =INDEX({"","abc","def","ghi"},SUM(1,$J$3>=0,$J$3>25000,$J$3>50000))
    Last edited by TheChatty; 03-12-2018 at 12:16 PM.

+ 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] Formula to compare multiple cells and do a calculation
    By steph1111 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-01-2017, 01:49 PM
  2. Compare multiple cells to see if they match exactly
    By redwine in forum Excel General
    Replies: 12
    Last Post: 08-24-2016, 11:28 PM
  3. [SOLVED] Macro or formula to change color in numbers after compare in multiple cells
    By lagiosman in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-30-2015, 06:54 AM
  4. Compare multiple cells at the same time
    By fgq in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-28-2013, 07:58 AM
  5. Formula to compare if multiple cells no longer blank
    By pdauction in forum Excel General
    Replies: 2
    Last Post: 04-21-2011, 08:31 AM
  6. to compare data in multiple cells
    By magendiran.thiru in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-21-2010, 04:12 AM
  7. [SOLVED] Formula to compare multiple cells
    By in forum Excel General
    Replies: 7
    Last Post: 05-21-2005, 08:06 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