+ Reply to Thread
Results 1 to 9 of 9

ctrl+shift+enter and if function

  1. #1
    Registered User
    Join Date
    11-11-2019
    Location
    romania
    MS-Off Ver
    2013
    Posts
    5

    ctrl+shift+enter and if function

    Hello!

    When i'm using this formula:
    {=IF(AND(Pontaj!M9:V9="CFS";SUM(Pontaj!M9:V9)=0);"CFS";IF(AND(Pontaj!M9:V9="CO";SUM(Pontaj!M9:V9)=0);"CO";IF(AND(Pontaj!M9:V9="LP";SUM(Pontaj!M9:V9)=0);"LP";IF(AND(Pontaj!M9:V9="N";SUM(Pontaj!M9:V9)=0);"N";IF(AND(Pontaj!M9:V9="L";SUM(Pontaj!M9:V9)=0);"L";IF(AND(Pontaj!M9:V9="CM";SUM(Pontaj!M9:V9)=0);"CM";SUM(Pontaj!M9:V9)))))))} when the result it should be "CFS" or "CO" or "lp" etc., i get the result 0. What should i do to get the result "CFS"?
    Thank you!

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: ctrl+shift+enter and if function

    This wont solve your problem but you can shorten that formula by taking the

    IF(SUM(M9;V9)=0,

    out of the ANDs

    removing the AND()s so it says something like

    =IF(SUM(Pontaj!M9:V9)=0;IF(Pontaj!M9:V9="CFS";"CFS";IF(Pontaj!M9:V9="CO";"CO"... etc
    Last edited by Special-K; 11-11-2019 at 11:27 AM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

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

    Re: ctrl+shift+enter and if function

    You will need to change this bit:

    =IF(AND(Pontaj!M9:V9="CFS";

    to this:

    =IF(AND(COUNTIF(Pontaj!M9:V9;"CFS");

    and make similar changes for other terms that are like this:

    Pontaj!M9:V9="CO";

    and then you won't have to use CSE to commit the formula.

    Hope this helps.

    Pete

  4. #4
    Forum Contributor
    Join Date
    10-30-2019
    Location
    Bistrita, Romania
    MS-Off Ver
    2019; 365
    Posts
    231

    Re: ctrl+shift+enter and if function

    Are all values in M9:V9 equal to one of: CFS, CO, LP, N, L CM?
    Or the row contains at least 1 different value?
    Because for Pontaj!M9:V9="CFS" to be true, all values of cells in range M9:V9 must be CFS.
    See image below for an example of what I mean:

    Pontaj.png

    In range Pontaj!M9:V9 you also have numbers, or just one of CFS, CO, LP, N, L CM?
    If you only have those and no numbers, the sum of letters only (CFS, CO, LP, N, L CM) will always be 0 so that part of the equation would not be required...

    And to answer your question, in order to have the result "CFS" you should make sure that all values in range Pontaj!M9:V9 are CFS, like my first example above.
    Last edited by Mrrrr; 11-11-2019 at 01:37 PM.

  5. #5
    Registered User
    Join Date
    11-11-2019
    Location
    romania
    MS-Off Ver
    2013
    Posts
    5

    Re: ctrl+shift+enter and if function

    Hello Pete_UK!

    It's working! Thank you very much for help!


    Cristina

  6. #6
    Registered User
    Join Date
    11-11-2019
    Location
    romania
    MS-Off Ver
    2013
    Posts
    5

    Re: ctrl+shift+enter and if function

    Hello!

    Thank you!

  7. #7
    Registered User
    Join Date
    11-11-2019
    Location
    romania
    MS-Off Ver
    2013
    Posts
    5

    Re: ctrl+shift+enter and if function

    Quote Originally Posted by Special-K View Post
    This wont solve your problem but you can shorten that formula by taking the

    IF(SUM(M9;V9)=0,

    out of the ANDs

    removing the AND()s so it says something like

    =IF(SUM(Pontaj!M9:V9)=0;IF(Pontaj!M9:V9="CFS";"CFS";IF(Pontaj!M9:V9="CO";"CO"... etc

    Thank You!

  8. #8
    Registered User
    Join Date
    11-11-2019
    Location
    romania
    MS-Off Ver
    2013
    Posts
    5

    Re: ctrl+shift+enter and if function

    Quote Originally Posted by Pete_UK View Post
    You will need to change this bit:

    =IF(AND(Pontaj!M9:V9="CFS";

    to this:

    =IF(AND(COUNTIF(Pontaj!M9:V9;"CFS");

    and make similar changes for other terms that are like this:

    Pontaj!M9:V9="CO";

    and then you won't have to use CSE to commit the formula.

    Hope this helps.

    Pete
    Hello Pete_UK!

    It's working! Thank you very much for help!


    Cristina

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

    Re: ctrl+shift+enter and if function

    Glad to help, and thanks for marking the thread as solved.

    I see you have thanked a few other people, so you might also like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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: 4
    Last Post: 04-27-2021, 11:49 AM
  2. Replies: 15
    Last Post: 01-03-2018, 03:32 PM
  3. Why we use Ctrl+Shift+Enter key
    By Terressa in forum Excel General
    Replies: 1
    Last Post: 07-07-2015, 05:56 AM
  4. With VBA Enter Ctrl Shift Enter For Array Formula
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-17-2013, 09:02 AM
  5. [SOLVED] Ctrl+shift+enter
    By stuntmannen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-06-2013, 09:56 AM
  6. [SOLVED] What does Ctrl+Shift+Enter do? How does it differ from Enter?
    By George Furnell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-16-2006, 02:45 AM
  7. Replies: 2
    Last Post: 10-20-2005, 05:05 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