+ Reply to Thread
Results 1 to 23 of 23

Logical Function Issue

  1. #1
    Registered User
    Join Date
    08-19-2015
    Location
    Ontario
    MS-Off Ver
    Office Home and Business 2013
    Posts
    19

    Question Logical Function Issue

    Hello,

    I am attempting to get a logical function to do the following:

    In cell G10 I have a formula that tells me the mode of a certain word that will appear based on choices made. I would like the cell beside that to if the word is "maintenance" select the data from cell A11, if it is not then "" or 0. The formula I had attempted to you which seemed as if it should work is =IF(G10="Maintenance",A11,0) with this formula it will only give me 0 even if the text is Maintenance, if I change the order in the formula to =IF(G10="Maintenance",0,A11) then it will only give me the A11 data regardless of which word shows in cell G10.

    I am at a loss hoping someone can please help. Can this be done or do I need to be using VBA to do this and using else strings. Please let me know if you have a solution.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Logical Function Issue

    Therefore, G10 does not equal "Maintenance" Check for leading or trailing spaces.
    If G10 is populated via a formula, copy G10 and paste speecial >Values to inspect it better for spaces.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    08-19-2015
    Location
    Ontario
    MS-Off Ver
    Office Home and Business 2013
    Posts
    19

    Re: Logical Function Issue

    The issue is G10 does = maintenance and I have double verified there are no spaces. I even tried it with a different text =IF(G10="Agri-Cat",A12,A11) this one will only pull the info from A11 regardless of the text it will not populate A12 info.

  4. #4
    Registered User
    Join Date
    08-19-2015
    Location
    Ontario
    MS-Off Ver
    Office Home and Business 2013
    Posts
    19

    Re: Logical Function Issue

    Not sure if this makes a difference but here is the formula used in G10 to populate the text =INDEX(B12:D12,MODE(MATCH(B12:D12,B12:D12,0)))

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Logical Function Issue

    What does this return
    =LEN(G10)
    ?

    Post a sample workbook.


    You can rest assured, Excel won't lie to you.
    If the formala says G10 does not = "Maintenance", then it doesn't.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Logical Function Issue

    If G10 contains Maintenance, what result do you get from this formula:

    =LEN(G10)=LEN("maintenance")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  7. #7
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Logical Function Issue

    Quote Originally Posted by TanyaMatt View Post
    =INDEX(B12:D12,MODE(MATCH(B12:D12,B12:D12,0)))
    Examine the cell in B12:D12 that this formula returned it's value from.
    See if it contains extra spaces.

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Logical Function Issue

    You can rest assured, Excel won't lie to you.
    Ha! Wish I had a nickel for every time I heard that!

  9. #9
    Registered User
    Join Date
    08-19-2015
    Location
    Ontario
    MS-Off Ver
    Office Home and Business 2013
    Posts
    19

    Re: Logical Function Issue

    I am getting false

  10. #10
    Registered User
    Join Date
    08-19-2015
    Location
    Ontario
    MS-Off Ver
    Office Home and Business 2013
    Posts
    19

    Re: Logical Function Issue

    No spaces by the looks of it

  11. #11
    Registered User
    Join Date
    08-19-2015
    Location
    Ontario
    MS-Off Ver
    Office Home and Business 2013
    Posts
    19

    Re: Logical Function Issue

    How do I post the workbook for you to see?

  12. #12
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Logical Function Issue

    Quote Originally Posted by TanyaMatt View Post
    I am getting false
    To which formula?
    Quote Originally Posted by Tony Valko View Post
    what result do you get from this formula:

    =LEN(G10)=LEN("maintenance")
    Or
    Quote Originally Posted by Jonmo1 View Post
    What does this return
    =LEN(G10)
    ?
    What was the result of Each formula?

  13. #13
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Logical Function Issue

    Quote Originally Posted by TanyaMatt View Post
    How do I post the workbook for you to see?
    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Logical Function Issue

    Quote Originally Posted by TanyaMatt View Post
    I am getting false
    OK, that means G10 does not contain just Maintenance.

    What results do you get from these formulas:

    =CODE(G10)

    =CODE(RIGHT(G10))

  15. #15
    Registered User
    Join Date
    08-19-2015
    Location
    Ontario
    MS-Off Ver
    Office Home and Business 2013
    Posts
    19

    Re: Logical Function Issue

    Please Login or Register  to view this content.
    Above is without showing the formulas, Below shows them

    Please Login or Register  to view this content.

  16. #16
    Registered User
    Join Date
    08-19-2015
    Location
    Ontario
    MS-Off Ver
    Office Home and Business 2013
    Posts
    19

    Re: Logical Function Issue

    =LEN(G10)=LEN("maintenance") gives false =LEN(G10) gives 9

  17. #17
    Registered User
    Join Date
    08-19-2015
    Location
    Ontario
    MS-Off Ver
    Office Home and Business 2013
    Posts
    19

    Re: Logical Function Issue

    I think I have attached the whole workbook correctly here.
    Attached Files Attached Files
    Last edited by TanyaMatt; 08-19-2015 at 02:12 PM.

  18. #18
    Registered User
    Join Date
    08-19-2015
    Location
    Ontario
    MS-Off Ver
    Office Home and Business 2013
    Posts
    19

    Re: Logical Function Issue

    =CODE(G10) is 65
    =CODE(RIGHT(G10)) is 32

  19. #19
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Logical Function Issue

    On the Feeding Rates-Costs sheet, cells A3 and A4 have trailing space characters and this is being propagated to your formulas that reference these cells.

  20. #20
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Logical Function Issue

    Take a very close look at A4 in the sheet 'Feeding Rates-Costs'
    Don't just look at the cell..
    Click into the cell (click to the right side of the text in the cell) as if to add text to it, and look at the formula bar.

  21. #21
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Logical Function Issue

    Quote Originally Posted by TanyaMatt View Post
    =CODE(G10) is 65
    =CODE(RIGHT(G10)) is 32
    65 = uppercase A
    32 = space character

  22. #22
    Registered User
    Join Date
    08-19-2015
    Location
    Ontario
    MS-Off Ver
    Office Home and Business 2013
    Posts
    19

    Re: Logical Function Issue

    Well I'll be.... Went through and removed ALL spaces from everything in A column in the Feeding Rates-Costs and now we are in business

  23. #23
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Logical Function Issue

    Good deal. Thanks for the feedback!

    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

+ 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. Logical Function
    By L1r in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-08-2010, 11:15 AM
  3. Complicated Logical Formula issue
    By Landtuber in forum Excel General
    Replies: 4
    Last Post: 05-05-2010, 12:29 AM
  4. Logical Function Help
    By DAlter in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-18-2008, 06:45 PM
  5. Issue with representing a blank in a logical expression.
    By Van in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-05-2005, 04:30 PM
  6. [SOLVED] Logical Function
    By brandyda in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 01:05 AM
  7. Logical AND function
    By John Pinback in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-03-2005, 05: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