We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

Matching Values in Excel

Hi All,

Is it possible do the following?

In Cell C2 I want to perform a function that checks if cell B2 = Arsenal and if it does I want the value in cell A2 returned.

Is this possible and if so what code is used?

Thanks

Comments

  • WTFH
    WTFH Posts: 2,266 Forumite
    What is your value you want displayed? Is it calculated somewhere?


    =IF(B2 = "Arsenal", your value, " ")
    1. Have you tried to Google the answer?
    2. If you were in the other person's shoes, how would you react?
    3. Do you want a quick answer or better understanding?
  • Is there a way of returning "0" instead of FALSE if the critera does not match?
  • WTFH
    WTFH Posts: 2,266 Forumite
    Yes, to return a zero, just put it in as the final value in the argument:

    =IF(B2 = "Arsenal", your value, 0)
    1. Have you tried to Google the answer?
    2. If you were in the other person's shoes, how would you react?
    3. Do you want a quick answer or better understanding?
  • Brilliant, the code I was using was overly complicated.
  • WTFH
    WTFH Posts: 2,266 Forumite
    Were you trying to calculate the time since they last won a trophy?

    http://www.sincearsenallastwonatrophy.co.uk/

    (sorry, couldn't resist!)
    1. Have you tried to Google the answer?
    2. If you were in the other person's shoes, how would you react?
    3. Do you want a quick answer or better understanding?
  • JimmyTheWig
    JimmyTheWig Posts: 12,199 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Combo Breaker
    I don't _know_ what you are trying to achieve, but I don't think that this is the way to do it!
    Is this the same spreadsheet as last week that used vlookup?
    Are both lists in alphabetical order? If not, the 'if()' on this page won't be much help. If they are in alphabetical order then the 'if()' on this page isn't necessary as you know that B2 will be Arsenal.
This discussion has been closed.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 353.5K Banking & Borrowing
  • 254.1K Reduce Debt & Boost Income
  • 455K Spending & Discounts
  • 246.6K Work, Benefits & Business
  • 602.9K Mortgages, Homes & Bills
  • 178K Life & Family
  • 260.5K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.