How to show multiple or all values in column C based on combination of column A and column B in Excel - excel

Consider 3 columns below. For every unique combination of column A and column B I need to return the corresponding values(could be either 1 or 2) in column C.
A B C
USA Jan winter
USA Feb fall
USA Feb summer
China Jan summer
China Jan spring
China May fall
India Jan fall
India Feb summer
India May Rain
USA Jan Summer
Now, say for a random row 25, I have A25 as a dropdown list with value selected ="USA" and B25 as a dropdown list with value selected="Feb", in which case I would want C25 to have a dropdown list with the value in it being "Fall" and "Summer".
I did refer to this thread, It only returns me the first matched value which in my example is only "Fall". Although, I would want both the values returned("Fall" and "Summer").
The formula is used:
=INDEX(C2:C11,INDEX(MATCH(1,(A2:A11=A25)*(B2:B11=B25),0),0))
Any ideas on this would be helpful.
Thank you!

Related

date based on yes or no value in another column

Column G will either be blank or have a yes or no in it. Column L has a date value in it. IF column G has a yes in it I want column R to subtract 9 months from the date in column L. If column G is blank or no I want Column R to remain blank.
Enter this formula in column R (the below formula will work for row 2):
=IF(G2="Yes",DATE(YEAR(L2),MONTH(L2)-9,DAY(L2)),"")
Note that the adjustment of 9 months might look a bit odd. If your date is, say, 30 November 2018, the formula is supposed to return 30 Feb 2018. However, since no date exists, it will instead return 02 March 2018 (which is Excel's way of saying as two days after 28 February 2018).

If condition to count column values based on index number

I have 14 column with 1st column (say A) containing the month value (1 for Jan, 2 for Feb and so on). Colum B contain a number representing 2017 year value. For the next 12 columns starting column C onwards, there are values for each month of 2018 starting from Jan 2018 till Dec 2018. In Col 15, i want to sum value of 2017 (Column B) with corresponding months in 2018 based on the month value in Column A. For example, if the month value is 3, then the result should give me the sum of values in column B(2017) + column C(Jan2018) + column D(Feb 2018) + column B (Mar 2018). Since month value 3 represents March 2018.
I tried to use the function Choose but seems too length. Is there a smaller and easy function?
=SUM(B2:INDEX(C2:N2,1,A2))
INDEX(C2:N2,1,A2) here gives the reference within C2:N2 at row 1 and column from cell A2. The range from SUM then becomes B2 to the reference obtained from INDEX.

Excel function to Auto-Populate value in Column C based on the combination of values in column A and Column B

I have 3 columns with values filled in already in my metasheet. A combination of values in column A and column B makes the selection unique. I need to pull/return the value in column C for the values selected in columns A & B. for example: In sheet 1, I have the following data:
country Month weather
1 USA Jan winter
2 USA Feb fall
3 USA May summer
4 China Jan summer
5 China Feb spring
6 China May fall
7 India Jan fall
8 India Feb summer
9 India May Rain
Now, say for a random row 25, I have A25 as a dropdown list with value selected ="India" and B25 as a dropdown list with value selected="Feb", in which case I would want C25 to have a dropdown list with the value in it being "Summer".
I tried this formula:
=VLOOKUP(B25, OFFSET(B$1:C$9, MATCH(A25,A$1:A$9,0)-1, 0, 2, 2), 2, 0)
But this one gives me an error: "The list source must be a delimited list, or a reference to a single row or column".
I did refer to this solution. But I get the above mentioned error as the data validation for C25 is a list.
Any suggestions/ideas on this would be helpful!
Thank you!
If your sheet is set-up like this:
You can use:
=INDEX(C2:C10,INDEX(MATCH(1,(A2:A10=E2)*(B2:B10=F2),0),0))
You will need to make a second sheet with a matrix like following -
Here you will define all the weathers for country and month pair. I have used the default name i.e. Sheet2 and filled the values that were available from your data. You will lookup the values from this for filling on Sheet1. Sheet1 will be like this -
=VLOOKUP(B2,Sheet2!$A$1:$D$13, MATCH(A2, Sheet2!$A$1:$D$1, 0), FALSE)
Here B2 is the month value, A2 is the country value. Sheet2!$A$1:$D$13 is the range for VLOOKUP and Sheet2!$A$1:$D$1 is the range for MATCH. VLOOKUP will match the month, MATCH will match the country and get the column index.

Predict number of employees for upcoming months

I have an Excel sheet with columns for the start and end dates of employees in a project. Like:
Name (Cell A1) Start Date(Cell B1) End Date(Cell C1)
John Doe (A2) 9/1/2015 (B2) 3/1/2016 (C2)
D Barret (A2) 8/1/2015 (B2) 2/1/2016 (C2)
D Barret (A2) 7/1/2015 (B2) 8/1/2015 (C2)
Based on these start and end dates, I want to count the number of resources in the next months:
Month (F1) #Employees (G1)
Jan 2016 2
Feb 2016 3
I want to autopopulate the #Employees column with numbers based on the start and end dates. So if there are three people who start/continue in February of 2016, then I will have those three minus the people who leave in January.
What would be the best way of achieving this in Excel?
See the formula in cell B9 below. I am a little confused on exactly what you are asking for. The below function will count the amount of employees that are currently working in January 2016. So essentially the Jan 2016 has to be between the employees start date and end date.

Sum a column in Excel based on two references in the column and two filter reference columns

I need to sum the valumes of a column, but I need to identify the column based on two values in the column and I have to filter it by the values in two adjecent columns.
Here is an example:
Reference1 Act. Act. Act. ... Bud. Bud. Bud.
Reference2 Jan Feb Mar ... Jan Feb Mar
Reference3 Reference4
CAR BLUE 1 2 3 4 5 6
CAR BLUE 1 2 3 4 5 6
CAR RED 1 2 3 4 5 6
So, I have to add all the CAR & BLUE & Act. & Jan = 1+1 = 2. And similarly for the other columns.
I would like to achieve something as follows:
Reference3 Reference4 Reference1 Reference2 Value
CAR BLUE Act. Jan 2
CAR BLUE Act. FEB 4
The problem I have is that formula to use in the Value column above. I can not do a SUMIFS as the columns in the original source table change. A VLOOKUP don't work as there is no single column for the lookup_value. I thought about using MATCH to identify the column, but as I have two references(1&2) it doesn't work either.
Any ideas on what formula(s) I could use to achive the above.
Thanks
Try making a pivot table from your data (this will not make formulas, though, but will nevertheless give you the desired results).
Here is a simple guide on doing that in Excel 2003 - http://www.techonthenet.com/excel/pivottbls/create.php
You can create a Key in a column:
= Reference3 & Reference4 & Reference1 & reference2
and after use the Subtotal command (Inside Data).
Every time you modify the data, you need to reuse Subtotal

Resources