+ Reply to Thread
Results 1 to 5 of 5

Logical test argument answer = true for different cell value

  1. #1
    Registered User
    Join Date
    12-06-2016
    Location
    Missouri
    MS-Off Ver
    2016
    Posts
    3

    Logical test argument answer = true for different cell value

    Here is my formula:

    =IF(B2="JW",SUM(X2*$C$85),IF(B2="PA",SUM(X2*$C$95),IF(B2="CW1",SUM(X2*$C$95),IF(B2="",)))



    I want it to do the SUM if B2= CW1, CW2, CW3, CW4 or CW5.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,790

    Re: Logical test argument answer = true for different cell value

    Can there be a "CW6" in B2 (or some other code that starts with CW)?

    If not, you could do this:

    =IF(B2="JW",X2*$C$85,IF(B2="PA",X2*$C$95,IF(LEFT(B2,2)="CW",X2*$C$95,IF(B2="",))))

    Note: you don't need the SUM functions.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-06-2016
    Location
    Missouri
    MS-Off Ver
    2016
    Posts
    3

    Re: Logical test argument answer = true for different cell value

    There can be just a CW code.

    Thanks for the SUM tip , I'm trying to rewrite and old work sheet that someone else did and I'm not that good with excel myself but I seem to always have to learn something by being thrown into the fire...

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,790

    Re: Logical test argument answer = true for different cell value

    Then you could do this to exclude the value of "CW":

    =IF(B2="JW",X2*$C$85,IF(B2="PA",X2*$C$95,IF(AND(LEN(B2)=3,LEFT(B2,2)="CW"),X2*$C$95,IF(B2="",))))

    (changes in red).

    Hope this helps.

    Pete

  5. #5
    Registered User
    Join Date
    12-06-2016
    Location
    Missouri
    MS-Off Ver
    2016
    Posts
    3

    Re: Logical test argument answer = true for different cell value

    Thank you for the help.

+ 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: 7
    Last Post: 01-07-2015, 06:29 AM
  2. Replies: 2
    Last Post: 02-06-2013, 12:16 PM
  3. Logical test in IF function returning TRUE when it should be FALSE
    By lvjeff in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 11-28-2012, 05:13 PM
  4. Confirm True in Logical Test using Find
    By bdb1974 in forum Excel General
    Replies: 3
    Last Post: 11-09-2009, 01:44 PM
  5. =IF(logical test,value if true,value if false) always backwards!
    By chaminod in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-14-2005, 02:10 PM
  6. if logical test true, then hlookup, if false then difference betwe
    By VictoriaG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 AM
  7. [SOLVED] if logical test true, then hlookup, if false then difference betwe
    By VictoriaG in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-08-2005, 11:05 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