Test in an Excel spreadsheet

Solved
Hello,

I have a table with two columns and three rows

Apartment = 1
Garage = 0.5
Parking = 0.1

I want the value to be 1 if the cell content is "Apartment"
I want the value to be 0.5 if the cell content is "Garage"
I want the value to be 0.1 if the cell content is "Parking"

How can I program this in my Excel sheet?

5 answers

  • Votes
  • Date
  • Descending date
  1. Hello,

    Assuming that cell A1 contains the text and A2 the value, enter this formula in A2

    =IF(A1="Apartment",1,IF(A1="Garage",0.5,0.1))

    This means If A1 is equal to Apartment then 1 otherwise If A1 is equal to Garage then 0.5 otherwise 0.1.

    Best regards
    1. Yes, I have 16 possible cases that are on a separate sheet from the first one. I need to run a test on 16 values that are in a table, which should return the value corresponding to the second column of the same row.
      Thank you for looking into this matter.
    2. Contributor
      Maya, I think you missed the post below.
  2. Dear Chris
    This is my first request and my first participation in this forum. I'm discovering and I'm more focused on the functioning of the site than on good manners! You are absolutely right to remind me of some basic principles. So, I sincerely apologize and ask the internet users to forgive me.
    Thank you for your response. However, I simplified my problem to be understood. In fact, the list has 16 rows with different values. Can't we run a test on a range of cells?
    With my thanks for your responses!
    1. I'm having a bit of trouble understanding.
      Are you saying that there are 16 possible cases?

      Simplifying is fine, but it needs to be accurate.
      1. Contributor
        Hello,

        with your name/value table in: $G$2:$H$17:
        =VLOOKUP(A2,$G$2:$H$17,2,FALSE)

        eric

        --
        You will never respond to an unsolicited DM...
        Well, that's done.