New member here - have a question about developing a formula

3beejay3

New member
Joined
Oct 25, 2015
Messages
20
Reaction score
0
Points
0
Hi- new member here.

I'm building an employee expense form. I have to try and describe the issue, as the site won't let post a pic or copy of the sheet.....

I'm trying to build a formula that would automatically tally up data from a column, but subject to a term that is chosen from a drop down box in another column. The employee fills out the form & chooses the type of expense from the drop down list(ie mileage, meals, hotel etc) and fills in the data for each row. They repeat as often as necessary. The total would then be placed in another cell beside the appropriate term in a summary list.

Ie If the employee fills out the form and has three rows with mileage, 2 rows with accomodations and 4 rows with meal expenses, the formula would need to tally only mileage and send that to the summary cell beside mileage, meals beside the meals summary etc.

How do I do this?

Thanks in advance
 
It sounds like a formula based on the SUMIF function would do the job, but its difficult to be sure without seeing your data. I think that you need to have made 5 or 6 postings before the option to post attachments is switched on. You can check this by scrolling down to the bottom of the page to view your posting permissions after you have added the extra postings. Then post a sample worksheet. Also, take a look at the help available for SUMIF and you might be able to figure out if it will give you what you need.
 
I agree the SUMIF function could work, but am not sure how to use it here....... I would need a specific help example that matches mine perfectly, else I'll just get more confused.
 
I used the SUMIF function, but the first attempt didn't work. The fields and ranges all filled out as directed, but it's not delivering the desired result yet.
I'll post the formula and related info to see what went wrong...
 
This is the Formula I created using the Excel supplied formulas.
=SUMIF(J9:J24,"Travel",C9:C23)

'Travel' is the first term in the drop down lists in Column C. The result I get is 0 in the target cell in the Summary Table, no matter what is entered in column J.... What is wrong here?

attachment.php
 

Attachments

  • EXCEL exp sheet picture.jpg
    EXCEL exp sheet picture.jpg
    96.1 KB · Views: 29
Last edited:
Will post a pic of the sheet. (needed post count to post attachment above)
 
Hello
Originally, you said you wanted to tally-up some data based on criteria, so I suggested SUMIF, which expects to find some numbers to add up. At present, in your pictures Cols G to K are numeric but they are all zero values.
Looking at your formula:
=SUMIF(J9:J24, "Travel", C9:C23)
1. J9:J24 This is the range whose values excel will test using the Criteria you supply.
2. "Travel" This is the Criteria to be found in the Range above if there is anything to sum.
3. C9:C23 This is the range whose values you you want to sum. Its optional, and must have the same number of cells as 1. (which yours doesn't). If
this parameter is not given the cells in 1. (J9:J24) will be used for summing those that meet the criteria.

in this formula, theres nothing to add because none of the cells in the range J9:J24 have the value "Travel". Even if they did, there are no numbers to add in C9:C24.
If you are going to get a total or count for "Travel".

The sheet you provide doesn't show which values are in the "Travel" category, so it would not be possible to get any totals from it. Your formulae need to reference the other sheet(s) that provide this.
It would speed things up if you could post an example workbook with manual totals if necessary.
 
Working copy of sheet;

View attachment New Expense Report working copy.xlsx

The zero values in the columns are because no data has been put in them. When I test it I just add made up data.

The Criteria is in a range on the 2nd worksheet. The employee clicks the specified term in the drop downs in col C, which loads the criteria. It appears I may have the formula setup backwards?

(I entered the info as directed by the dialog box.....)
 
Last edited:
Got it working. the SUMIF I had was set up backwards. Here is what worked- =SUMIF($C$9:$C$24,K9,$I$9:$I$24) (one column was removed)

Thanks Hercules, for the help :)
 
Last edited:
Back
Top