Combox1 & Combobox2 equals specific cell

MerryMaca

New Member
Joined
Aug 4, 2010
Messages
2
Hello!
I don't know how to name this thread but I tried my best :). I am new at excel so I have a lot to learn. But so far I have managed to use VLOOKUP and managed to set a Combobox1(wich are rows) with list that I want (A15:A500).
What I have problem with is that I want Combobox2 that I want to have two specific cells that I can choose between no matter what I choose in Combobox1. Then I want to have a result based from what I've choosen. So result will be in a Textbox1 (wich is specific cell from row and cell choosen in comboboxes).

For e.g. Combobox1: Bergdalen(A20) + Combobox2: Boggibil(C13) equals Textbox1: 342,00 kr(D20)

Here is a picture to make it more clear:


Can anyone help please :)?
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,271
This is what I understand.

If Combobox2 is "Boggibil", you want to return a value from column D. If Combobox2 is "Bil & Slap", you want to return a value from column F. Is that correct?

You can link cells to your two comboboxes and your textbox. For this example...
Link Combobox1 to cell A1
Link Combobox2 to cell B1
Link Textbox1 to cell C1

Put this formula in cell C1
Code:
=IF(OR(A1="",B1=""),"",INDEX(OFFSET(A15:A500,,IF(B1="Boggibil", 3,5)),MATCH(A1,A15:A500,0)))
The formula will calculate a value for your text box. If A1 or B1 is empty, then c1 will be empty. Otherwise it looks up the value from A1 in A15:A500 and then returns the value for column D or F depending on what is in cell B1.
 

MerryMaca

New Member
Joined
Aug 4, 2010
Messages
2
Hi Alpha,
yes ... that's exactly what I want. But D column is a result from B + C and F column is a result from B + E
... and I'm not at all good at codes :( ... what I did in combobox1 is that I changed ListFillRange to Område1!A15:A500(Sheet1 is "Område"), that is what I managed to do so far... but I would really like to learn, and I did learn a lot on this forum :)

What I had in mind is to have a combobox1 with list from column that begins from A5 and combobox2 with just cells C14 & E14 so if I choose a column(combobox1) and a row(combobox2) that it automaticlly shows in a textbox1 a result from multiplying those two .. I did multiply those separate in columns D & F to make it easier for me :)
But to make it work I need help with coding :)

P.S. .. my version is in Swedish.
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,818
Messages
5,513,564
Members
408,959
Latest member
BenBez

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top