Excel combo Box referencing
Excel combo Box referencing
(OP)
How do you reference to a combo box, its hard to put into words I will explain what Im doing.
Im making a spreadsheet for a company, they need all there expenses for each day listed and they have several (around 20) catergories ranging from motoring to rent, ext. I need to spreadsheet to look in each combo box and when the box says motoring, I want it to pull the amount payed from the cell next to it and put in into a different page to be totalled.
can anyone help?
THANX
WILL
Im making a spreadsheet for a company, they need all there expenses for each day listed and they have several (around 20) catergories ranging from motoring to rent, ext. I need to spreadsheet to look in each combo box and when the box says motoring, I want it to pull the amount payed from the cell next to it and put in into a different page to be totalled.
can anyone help?
THANX
WILL
RE: Excel combo Box referencing
A B C
R1 Amount Pick A Category Category
R2 $10 <combo box> Rent
R3 $15 <combo box> Motoring
......etc.
R100 $25 <combo box> Motoring
Next define some names. Create the name VALUES for the range A2:A100. Create the name CATS for the range C2:C100.
To compute the total rent, use the following array formula:
=SUM(IF(cats="rent",1,0)*values)
**Remember to press CTRL-SHIFT-ENTER when entering this array formula, which will add the symbols { and } around the formula.
={SUM(IF(cats="cat1",1,0)*values)}
This formula works by "zeroing out" the values for the categories you are not interested in, leaving an array of 1s and 0s multiplied by the array of values, then summing the range of values that remains.
Repeat the above formula for each category.
Hope this helps!
RE: Excel combo Box referencing
First define the list of options (motoring...rent...???)with a name (Insert - Name - Define) somewhere on one of your worksheets, which can then be hidden.
On the sheet where people enter their expenses, highlight the cells than select Data - Validation... Under Allow: select list. For Source: enter =name (whatever name you used previously). There are options for prompt boxes too.
You can then reference the input cell as with any other. Hopefully you can follow this, I find this approach easier and more user-friendly than adding combo boxes to a worksheet, but hey, whatever works.
RE: Excel combo Box referencing
Use combo box from forms toolbar.
Right click, format control, control tab and set up list range and I usually put the cell link to the cell behind the combo box - when they select item 5 on the list, the cell hidden behind the combobox now contains the number 5 (obvious but making sure we're on same wavelength here!).
On next worksheer, or wherever then use the sumif satement to collect all values with value = 5 (say) in the columns containing the combo boxes.
Column A Column B
<combobox> Value
<combobox> Value
To total : =sumif(A1:A10,"=5",B1:B10)
Checks if value in column A is 5, if so, add number in column B to total.
As usual in Excel, many ways to do the same thing. Data validation with list option works just as well except now use the sumif statement with "=motor" or whatever category.