Is there a way I can count a specific string (Product) in a column times by the neighboring cell (Quantity) so show how much of a product I have sold [duplicate] - excel-formula

I'm wondering if there is an easy way to do what I'm looking for. Basically, I have a balance sheet in Excel 2011 with a bunch of data. One specific piece of information I always want visible is the amount that hasn't been reimbursed. In other words, I have a column for the amount paid and another for whether or not it has been reimbursed (Yes/No). I want to sum all of the amounts paid where the reimbursed field is equal to 'No'.
I recognize I can sum the entire column and filter out those that have been reimbursed, but I'd like it to display the full amount regardless of what filter is on (or if no filter is on).
I wasn't able to find good keywords to describe this to Google, so I'm asking here. I would like to accomplish this in Excel, not in an external program or script.

If column A contains the amounts to be reimbursed, and column B contains the "yes/no" indicating whether the reimbursement has been made, then either of the following will work, though the first option is recommended:
=SUMIF(B:B,"No",A:A)
or
=SUMIFS(A:A,B:B,"No")
Here is an example that will display the amounts paid and outstanding for a small set of sample data.
A B C D
Amount Reimbursed? Total Paid: =SUMIF(B:B,"Yes",A:A)
$100 Yes Total Outstanding: =SUMIF(B:B,"No",A:A)
$200 No
$300 No
$400 Yes
$500 No

You could do this using SUMIF. This allows you to SUM a value in a cell IF a value in another cell meets the specified criteria. Here's an example:
- A B
1 100 YES
2 100 YES
3 100 NO
Using the formula: =SUMIF(B1:B3, "YES", A1:A3), you will get the result of 200.
Here's a screenshot of a working example I just did in Excel:

You should be able to use the IF function for that. the syntax is =IF(condition, value_if_true, value_if_false). To add an extra column with only the non-reimbursed amounts, you would use something like:
=IF(B1="No", A1, 0)
and sum that. There's probably a way to include it in a single cell below the column as well, but off the top of my head I can't think of anything simple.

Related

Excel formula to find a number within a range of numbers and return a date

First time writing one of these, so I will try and explain what I'm trying to do in an understandable manner.
I'm trying to create a spreadsheet to track when a premium bond wins, and have it return the date that the winning premium bond was purchased. Because premium bonds cannot be purchased singularly, when you buy them your bond numbers are given to you a range (eg: 111AA111111- 111AA111210).
As this is the data they provide, I've set my spreadsheet up with purchase date in column A, first number of the range in column B, and last number of the range in column C.
Sample image of the sheet with example bond ranges and purchase date:
Now on a separate sheet I've listed the wins, with win date in A, winning bond number in B, and prize amount in C. In D or E I would like to somehow get it to then give me from the first sheet the date of purchase that winning bond was from.
Sample image of the sheet with winning bond numbers and month they won:
I've done a lot of googling and found similar threads to do this, but none of them have been quite what I want and I've not yet been able to work out how to tweak them into doing it. These have used index and sumproduct, but I'm yet to get it to work.
Any help in the right direction is greatly appreciated. If this doesn't make sense let me know and I'll try and explain it better.
So, like this:
INDEX($B$3:$B$5,MATCH(C9,$C$3:$C$5,1))
Not added a constraint to limit to the upper value, but you could.
This answer is pretty much the same than #SolarMike's answer but based on a diferent point of view.
If the pattern is always like 111AA111111 where 1 is a numeric value and AA is a text value and unique then you can extract the text part from each id using function MID and search for it with INDEX and MATCH:
Formula is:
=INDEX($A$1:$A$3;MATCH("*"&MID(B9;4;2)&"*";$B$1:$B$3;0))
But for this to work each AA must be unique.

In Excel, "if greater than 0 and less then 10 then "x", but if greater then 10 and less then 20 then "y" in same cell

I am trying to create a formula to calculate shipping based on price but I have only been able to find this:
=IF(AND(D2>0.01,D2<13.51),4.51,"")
Basically it reads "If the total purchase (D2) is greater then $0.01 and less then $13.51 apply $4.51 as the shipping fee. This works for the one fee but I need it to apply the other fees as well and I cannot seem to figure out how to do multiple greater than, less than in one formula.
So I need to be able to add multiple of that same code and change the numbers, but I can't figure out how to do multiple without getting an error.
VLOOKUP with approximate match sounds like it would be the easiest if you have a lot of shipping prices. The lookup table is in grey and you can setup however you like. If column 'B', put the formula =VLOOKUP(A2,$D$2:$E$5,2,TRUE) The TRUE is was provides the approximate match.
A nested IF would work, but would be horrible to manage. Using the VLOOKUP, anyone could maintain the lookup table.

How to choose the highest number from a set of same names?

I am trying to modify an already existing Excel file for a client. Here is the deal. They have the following Excel sheet with these columns (the picture is a simplified version of course to make it clear to you):1
If a student has completed their Bachelor they get a 1 in the Bachelor Done column, if not they get a 0. Now what they want is to check if at least one person per city has completed their Bachelor and display this in a new table with two columns (First column with the city name and second column with a Note of Yes or No).
For example let's take Lisbon. It has 2 students, George and Helen. In this case George has not completed his bachelor yet (0) but Helen has (1). In that case, Lisbon qualifies and should get a Note of YES in the new table.
Is there any way to implement this in Excel via an IF or a VLOOKUP function? I tried, but my Excel knowledge is quite limited. They also do not want to change the format of the file, as lots of people are already working with this and they are familiar with. Best case scenario could probably be the addition of extra columns.
My question is if there is a way to find for every city the highest Bachelor Done number and based on that to have a Yes or No output. The numbers for Bachelor will always be 1 or 0. So if a city has 1 and 0, 1 should be taken and display yes. If there is a city with 3 people and only zeros, No should be displayed.
If you need any clarification, please let me know.
First copy and paste all your distinct City names into a column, then remove duplicates (data... remove duplicates). In my case, I did that in column F. Then in column G, input a formula such as this:
=IF(MAXIFS(C:C,A:A,F2) = 1, "YES", "NO")
Results:

Excel Sumif, Sumifs with partial strings in multiple columns?

So this is the simplified question I broke down from a former question I had here: Excel help on combination of Index - match and sumifs? .
For this one, I have Table1 (the black-gray one) with two or more columns for adjustments for various order numbers. See this image below:
What I want to achieve is to have total adjustments for those order numbers that contain the numbers in Total Adjustment column in the blue table, each of which will depend on the cell beside it.
Example: Order number 17051 has two products: 17051A (Apple) and 17051B (Orange).
Now what I want to achieve in cell C10 is the sum of adjustment for both 17051A and 17051B, which will be: Apple Adjustment (5000) + Orange Adjustment (4500) = 9500.
The formula I used below (and in the image) kept giving me error messages, and this happens even before I add the adjustment for Orange.
=SUMIF(Text(LEFT(Table1[Order Number],5),"00000"),text(B10,"00000"),Table1[Apple Adjustment])
I have spent the whole day looking for a solution for this and didn’t even come close to find any. Any suggestion is appreciated.
Assuming your headers always have the text "adjustment" in them, you could use:
=SUMPRODUCT((LEFT($B$4:$B$7,5)=B10&"")*(RIGHT($C$3:$F$3,10)="adjustment")*$C$4:$F$7)
In C10 you could add two sumproducts. This assumes that products are always 5 numbers long at the start. If not swop the 5 to use the length of the product reference part you are matching on.
=SUMPRODUCT(--(1*LEFT($B$4:$B$7,5)=$B10),$D$4:$D$7)+SUMPRODUCT(--(1*LEFT($B$4:$B$7,5)=$B10),$F$4:$F$7)
Which with table syntax is:
=SUMPRODUCT(--(1*LEFT(Table1[Order Number],5)=$B10),Table1[Apple Adjustment])+SUMPRODUCT(--(1*LEFT(Table1[Order Number],5)=$B10),Table1[Orange Adjustment])
Using LEN
=SUMPRODUCT(--(1*LEFT(Table1[Order Number],LEN($B10))=$B10),Table1[Apple Adjustment])+SUMPRODUCT(--(1*LEFT(Table1[Order Number],LEN($B10))=$B10),Table1[Orange Adjustment])
I am multiplying by 1 to ensure Left, 5 becomes numeric.

excel rows,find if include,low and high

it seems that i cant post my picture.here is my link to it:
picture: http://s18.postimg.org/nfv997rvd/head.png
Hello Stackoverflow.
I have some things I wondering about here. I'll try to take it step by step:
It is marked in orange color:
As mentioned in the example in the picture it says "headphones". I would like it to search through all the lines in column A, to find something that has that name in it, then it should count the number of people, and come out with the number (in how many)
the "middle price" I want it to take the price of B (depending on where it found it called headphones) and take the average price of it.
In secured, as I would like it to count how many of them (from the number, or from the beginning) that have "secured" as "no" and "yes."
would like to use this on several things.
pink:
where would I find the average price of all the goods, and what the name of the particular item is.
same with the highest and lowest price.
How can I do this?
to find out how many Headphones:
=COUNTIF(A:A,"*Headphones*")
Note the *'s around the word so it can be found anywhere in the text to make a match.
For middle price there are 2 options, depending on how you want to define the average.
If it's a straight average:
=AVERAGEIF(A:A,"*Headphones*",B:B)
If you want the median, then you will have a slightly more complex formula with
=MEDIAN(IF(A1:A100="*Headphones",B1:B100))
and entered as an array formula with Ctrl+Shift+Enter
maximums and minimums can also be found with the same type of array formula
=MAX(IF(A1:A100="*Headphones",B1:B100))
=MIN(IF(A1:A100="*Headphones",B1:B100))
Excel also has COUNTIFS for multiple criteria:
Secure/Not Secure Headphones:
=COUNTIFS(A:A,"*Headphones*",E:E,"Ja")
=COUNTIFS(A:A,"*Headphones*",E:E,"Nei")

Resources