excel: sum of currency in two columns - excel

I've got an expenses form for my work which, to be fair, is terrible. I constantly have to fill them out and so I'm trying to add some formulae to speed up the process.
I want to sum the total money which would be a simple =sum(). However my problem is that the money is split into two columns | £ | p | which means that I end up with the pence column not over flowing into the pounds when it hits 100. I cannot change the format of the form.
Example:
currently
| £ | p |
| 5 | 20|
| 4 | 90|
Total| 9 |110|
required
| £ | p |
| 5 | 20|
| 4 | 90|
Total| 10| 10|
Does anyone have any suggestions?
Answer (StackOverflow wont let me answer for 8 hours...)
Sorted it :)
The £ column I've summed and added to the sum of the pence column divided by 100 rounded down to the nearest integer:
=SUM(POUND COLUMN)+ROUNDDOWN((SUM(PENCE COLUMN)/100),0)
and then in the pence total I've summed the pence column, divided by 100, and then found the remainder using the MOD function
=MOD(SUM(PENCE COLUMN),100)

Just convert one of the values e.g. multiply pence by 100 to work in pounds, or divide the pounds by 100 to work in pence. You can do this in your SUM formula.
Ok for the Pounds Column I would do:
=SUM(B1:B2)+INT(SUM(C1:C2)/100)
And for the Pence Column I would do:
=MOD(SUM(C1:C2),100 )
Where B1:B2 is the range of pound values and C1:C2 is the range of pence values.

Related

Formula to find item from a list that has total price then cross reference the different lists that contain that item to find the value of item?

row example-
lets say in column one I have apple|banana|pear
column 2 is number of items in column 1 (3)
column 3 is total price of all 3 items (42)
so I know apple+banana+pear=42
Now throughout column 1 I have a bunch of variations of items with varrying amounts of 1-6 items(4 items apple|banana|pear|egg, etc.)
I could go through and filter the column for lists that contain lets say apples and find each price manually but I'm wondering if there is a formula that could complete this task automatically.
So in column 6-11 I would split the items so each has its own cell then in 12-17 I would run the formula to find the price of each item.
So for example it would look like
| 1 |2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| apple|banana|pear | 3| 42 |apple | banana | pear | 14 | 16 | 12|
So far all I have done is split each list into their own cells, and wrote a formula to figure out how many items in each list. I don't really know how to figure this out without AI or if its even possible on excel. I guess maybe vlookup a value and divide total by number of containers then average because I have about 1000 rows of lists so maybe it will give me the best estimate?

Using Index/Match with an array and multiple match types

Maybe I'm going about it all wrong so I'm open to all suggestions.
I am trying to assign a grade (A-F) to a row based on a percentage. The criteria is as follows:
A = 0
B = +/-2
C = +/-15 (between 2 and 15 %)
D = +/-25 (between 15 and 25 %)
F = +/-26 or more
| **Percent Remaining** | **Grade** |
| :-------------------: | :-------: |
| 0.00% |A
| -1.77% |B
| 5.5% |C
| -18.53% |D
| 27.4% |F
So these are percentages of budgets spent so the criteria needs to be positive or negative so, for example overspending by 1.77 percent would have return a value of -1.77% and a "B" grade would need to be assigned or under spending returns a positive number which should yield the same results. I don't know why the markdown tips are not working for me for tables.
Thanks in advance
Create a lookup table with the Absolute thresholds and the corresponding result.
Then use VLOOKUP on the Absolute of the value:
=VLOOKUP(ABS(A1),C:D,2,TRUE)
Or you can use a hard coded INDEX/MATCH:
=INDEX({"A","B","C","D","F"},MATCH(ABS(A1),{0,.0001,.0201,.1501,.2501}))

How do I pair adjacent cells with one another in Excel?

I am attempting to create an efficient way to log our customer orders. So far what I've done is have the customer names in the 1st column. Contact details in the 2nd. Then in the sequential columns I have created drop down boxes to select the appropriate product and in the following column is the quantity.
Because of how customers order, the same products may not necessarily be in the same column Meaning it may read something like this...
Name. Number. Product1. Qty Product2. Qty. Product3. Qty
Name. Number. Product 3. Qty. Product 1. Qty. Product 2. Qty.
Name Number.. Product 3. Qty.
Name. Number. Product 2. Qty. Product 3. Qty.
So what I want to do is create a totals list for each product by pairing it with the relevant qty. But I'm struggling to find an appropriate method. So far I have found the means to count how many time each product is ordered, but not able to match that with the qty.
So if someone can help me do so I would much appreciate it.
p.s. I am using Excel 2007
It won't be a short formula as you need to specify each of the columns that need to be summed, but the best function would be SUMIF which uses this syntax:
SUMIF(range, criteria, [sum_range])
Applied to your data you would need to also use SUM to total the totals of each column, for example if your data looked like this:
| A | B | C | D | E | F | G | H
---------------------------------------------------------------------
1| Name | Number | 1 | Qty | 2 | Qty | 3 | Qty
2| Test1 | 123 | Product1 | 4 | Product2 | 5 | Product3 | 2
3| Test2 | 456 | Product3 | 2 | Product1 | 1 | Product2 | 5
4| Test3 | 789 | Product3 | 3 | | | |
5| Test4 | 112 | Product2 | 2 | Product3 | 1 | |
You could use the following formula to total all the Products named "Product1":
=SUM(SUMIF(C2:C5,"Product1",D2:D5),SUMIF(E2:E5,"Product1",F2:F5),SUMIF(G2:G5,"Product1",H2:H5))
Which would equate to 5 using the example data.

Counting the frequency of combinations of numbers (in excel using VBA)

I want excel to count the FREQUENCY that certain number-letter combinations appear down a column in excel (using vba). All my data goes down one column like this:
Column A (only 1,2,3,4,5,s,f appear)
1
2
s
4
3
s
4
2
f
2
s
2
s
I want to count the number of occasions combinations of (1-s, 2-s, 3-s, 4-s, 5-s) occur, strictly when the number occurs first (is in the higher row). I do not want to count occasions when the s comes before the number (e.g. s-2). I know how to count the number of individual letters/numbers using the countIf function.
I might later want to expand my analysis to look at the occasions that three letter-number combinations (e.g. 2-s-3, 2-s-5)
I am very much a VBA noob.
Try inserting a new column to the right of Column A. Use this formula =A1&A2 and fill it down the column. The values will look like this:
+----------+----------+
| Column A | Column B |
+----------+----------+
| 1 | 12 |
| 2 | 2s |
| s | s4 |
| 4 | 43 |
| 3 | 3s |
| s | s4 |
| 4 | 42 |
| 2 | 2f |
| f | f2 |
| 2 | 2s |
| s | s2 |
| 2 | 2s |
| s | s |
+----------+----------+
Now you can count occurences like you were doing before! :D
Of course, you can expand to three character frequency analysis by making the formula =A1&A2&A3.
Seems possible with COUNTIFS, with 1 to 5 inclusive in C1:G1 and in C2:
=COUNTIFS($A1:$A12,C1,$A2:$A13,"s")
copied across to suit.
You can use the VBA equivalent of this formula
=SUMPRODUCT(--(ISNUMBER(A1:A12)),--(A2:A13="s"))
which looks for number, followed by s in the row below (4 for your sample)
code
MsgBox Evaluate("SUMPRODUCT(--(ISNUMBER(A1:A12)),--(A2:A13=""s""))")

Average of multiple survey responses (columns)

I feel a bit embarrassed for asking this but here goes:
I'm using Excel 2010 and I have a worksheet containing 700+ customer satisfaction survey responses. Each row is a survey with a 1-5 or NA response to 5 questions. It looks like the following:
+-Agent--+--Q1--+--Q2--+--Q3--+
| | | | |
| Jeff | 5 | 5 | 5 |
+--------+------+------+------+
| James | 1 | 1 | 1 |
+--------+------+------+------+
| Jack | 5 | 5 | 5 |
+--------+------+------+------+
| Jeff | 3 | NA | 5 |
+--------+------+------+------+
| Jeff | NA | NA | 3 |
+--------+------+------+------+
| James | 5 | 5 | 5 |
+--------+------+------+------+
| ... | ... | ... | ... |
+--------+------+------+------+
I want to create a worksheet listing each agent in column A and the average of all of questions answered regarding them. I tried a formula like AVERAGEIF(SurveyResponses!A2:A7,A2,SurveyResponses!B2:D7) where A2 contains the agent's name, but it doesn't appear to work properly.
For example, I get a 5.00 average for some agents when it should be a 4.61. When I look in the Function Arguments screen for my AVERAGEIF on this person, it looks like it recognizes the values properly. The Average_rage shows {"NA","NA","NA","NA",1;5,5,5,5,5;5,... but the returned value below that says = 5 which is not right since there is a 1.
Can anyone guide me in the right direction?
AVERAGEIF works like SUMIF, the second range used is actually the same size and shape as the first range, starting with the top left cell, so when you use this
=AVERAGEIF(SurveyResponses!A2:A7,A2,SurveyResponses!B2:D7)
because the first range is a single column then the second range used must be too (there's a 1 to 1 relationship between the cells) so because the top left cell in SurveyResponses!B2:D7 is SurveyResponses!B2 the range begins there and is the same size and shape as SurveyResponses!A2:A7
....so you are actually getting this....
=AVERAGEIF(SurveyResponses!A2:A7,A2,SurveyResponses!B2:B7)
AVERAGEIF help does tell you that but it isn't very clear
If you want the ranges to be different sizes you need an "array formula" like this
=AVERAGE(IF(SurveyResponses!A2:A7=A2,SurveyResponses!B2:D7))
You need to confirm that with CTRL+SHIFT+ENTER so that curly braces appear around the formula in the formula bar. That formula will count any blanks as zeroes but ignore text values like NA
Easiest way to do this would be a pivot table. They look scary, but they're fairly easy to use. Rows = names, Columns = Q, Average for the answers.

Resources