+ Reply to Thread
Results 1 to 7 of 7

An IF Formula - Across 2 Columns and Return Value

  1. #1
    Registered User
    Join Date
    07-05-2020
    Location
    London, UK
    MS-Off Ver
    365
    Posts
    21

    An IF Formula - Across 2 Columns and Return Value

    Hi Guys,

    I am having trouble devising a formula which looks at the results from 2 columns together and compares them against a particular criteria and then returns a response.

    So basically: =IF(the term time in cell X = N and the submitted hours in cell Q are > 20, then return "Issue 1"; and if the term time in cell = Y and the hours in cell Z > 40, then return "Issue 2")

    Rule 1: If its term time and hours are > 20 then = "Issue 1")
    Rule 2: If its not term time and hours are > 40 then = "Issue 2")


    Does this make any sense to anyone?

    Ive attached a sample data if anyone can make sense of it??


    DK
    Attached Files Attached Files

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: An IF Formula - Across 2 Columns and Return Value

    Like this ?

    =IF(AND(F5="N",E5>20),"issue1",IF(AND(F5="Y",E5>40),"issue2",""))

  3. #3
    Registered User
    Join Date
    07-05-2020
    Location
    London, UK
    MS-Off Ver
    365
    Posts
    21

    Re: An IF Formula - Across 2 Columns and Return Value

    Hi Pepe,
    That is brilliant, that works. How do you know how to structure the argument, where to put the brackets etc? I find this very confusing to build.
    DK

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: An IF Formula - Across 2 Columns and Return Value

    Multiple failures and bitter experience... Great drivers to improving learning.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: An IF Formula - Across 2 Columns and Return Value

    Quote Originally Posted by Glenn Kennedy View Post
    Multiple failures and bitter experience... Great drivers to improving learning.
    And of course reading Glenn's posts...

  6. #6
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: An IF Formula - Across 2 Columns and Return Value

    Quote Originally Posted by Dark_Knight_897 View Post
    Hi Pepe,
    That is brilliant, that works. How do you know how to structure the argument, where to put the brackets etc? I find this very confusing to build.
    DK
    Just remember the syntax of the IF function
    IF something happens, do "this"
    if it does NOT do "that"
    now the "that" could be another IF and you can nest lots of them if needed ( which can often be avoided by careful selection of functions and a good data layout, which is essential for easy analysis)
    As for the brackets, they follow the same rules as basic arithmetic. If you open 10 brackets you have to close them.
    When I have a long formula I count the open and closed brackets, and correct as needed

  7. #7
    Registered User
    Join Date
    07-05-2020
    Location
    London, UK
    MS-Off Ver
    365
    Posts
    21

    Re: An IF Formula - Across 2 Columns and Return Value

    Hi Pepe,
    Ok Ill need to look into this again. I get the prinical of IF this, THEN that. The practice of doing it and changing bit and pieces of the formula is still trickey to get right.
    Ill reach out if any issues. I find without knowing the basics of the formulas like IFs and Pivots and other formulas, you cannot problem solve any issue given to you at work.
    Any pointers on where to learn the basics of IF statement structures? There are so many rubbish things on internet that always want to charge.
    Thanks again
    DK

+ 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 look at the Rows and Columns and return the number.
    By HamerTime7119 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-21-2020, 06:33 AM
  2. [SOLVED] Formula to query 3 columns and return a value if appropriate.
    By mmaskiell in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-24-2017, 10:26 PM
  3. [SOLVED] Formula to return date from 3 columns
    By BG1983 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-30-2016, 12:49 PM
  4. [SOLVED] IF formula, to evaluate two columns to return a new value
    By masond3 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-05-2013, 02:08 AM
  5. Formula to Return Previous Columns Value
    By aglopez08 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-10-2013, 11:56 AM
  6. Formula that return if any entry appear in all columns
    By bharatp83 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-12-2012, 05:25 AM
  7. formula to return value of several rows + columns
    By n1kk1 in forum Excel General
    Replies: 8
    Last Post: 09-15-2010, 07:47 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