# Logical Function Issue

1. ## 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. ## 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.

3. ## 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. ## 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. ## 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. ## Re: Logical Function Issue

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

=LEN(G10)=LEN("maintenance")

7. ## Re: Logical Function Issue

Originally Posted by TanyaMatt
=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. ## 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. ## Re: Logical Function Issue

I am getting false

10. ## Re: Logical Function Issue

No spaces by the looks of it

11. ## Re: Logical Function Issue

How do I post the workbook for you to see?

12. ## Re: Logical Function Issue

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

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

13. ## Re: Logical Function Issue

Originally Posted by TanyaMatt
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. ## Re: Logical Function Issue

Originally Posted by TanyaMatt
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. ## 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. ## Re: Logical Function Issue

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

17. ## Re: Logical Function Issue

I think I have attached the whole workbook correctly here.

18. ## Re: Logical Function Issue

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

19. ## 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. ## 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. ## Re: Logical Function Issue

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

22. ## 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. ## Re: Logical Function Issue

Good deal. Thanks for the feedback!

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

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### 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