row number of First cell in a column with specific condition - excel

The cells in column A are Date type.
How can I get the row number corresponding to the first cell whose month is equal to a certain number?

Try MATCH() function.
=MATCH(9,MONTH(A1:A12),0)
If you date stars from few row below then try
=MATCH(9,MONTH(A8:A19),0)+ROW($A$7)

Related

On Excel is it possible to apply a certain formula after a new date is written on another cell?

I would like to apply this formula =SUMIFS(K:K;A:A;A3) on a cell on a column only after a change in the date for example:
On this image the 14/12 a sum is calculated 2 times while I would love it if only on sum would calculate for each day. Is this possible maybe add a check weather whats MAX day?
Use =IF(COUNTIF(A$1:A3;A3)-COUNTIF(A:A;A3)=0;SUMIFS(K:K;A:A;A3);"") in the same row # as A3
The 1st countif is a counter from the first row up to the current row meeting the condition.
The 2nd countif is a counter of total occurances of the condition.
If 1st minus 2nd equals 0 it'll show your sumif formula, else it shows blank.

Find last entry of a column if another column contains a certain text

I'm trying to retrieve the last entry value (number) from a column only if a certain text exists in another column within the same row.
I can retrieve the last entry no problem. But I'd like to first match "BabyFoods" in column A before getting the value. Something like the SUMIF function that checks for certain values in a column before adding things in another column.
=LOOKUP(2, 1/(ISNUMBER(Transactions!H9:H1006)), Transactions!H9:H1006)
To find the last cell in Column A that contains BabyFoods, and return the corresponding value from Column H, try...
=LOOKUP(2,1/(Transactions!A9:A1006="BabyFoods"),Transactions!H9:H1006)
To find the last cell in Column A, where the corresponding cell in Column H contains a number, try...
=LOOKUP(2,1/((Transactions!A9:A1006="BabyFoods")*(ISNUMBER(Transactions!H9:H1006))),Transactions!H9:H1006)
Small example, hopefully it's usefull for your situation:
Formula in D1:
=MAX(INDEX((A2:A10="BabyFoods")*(B2:B10="X")*ROW(A2:A10),))
This will return the last row with the combination of criteria "BabyFoods" in column A and "X" in column B. You could apply another INDEX formula, if you would want to retrieve the value of a column.

Excel formula to return value of cell in column A based off the relative cell value in column B

I'm working on a spreadsheet that has order number's in column A and the associated dates in column B. I can seem to get a correctly functioning formula that will find the earliest date in column B and return the associated order number from column A.
I've tried using INDEX and VLOOKUP formulas and managed to get it to return a date using =MIN(IF(B$1:B$99,A$1:A$99,"")) but when reversed it only returns the lowest order number.
=MIN(IF(B$1:B$99,A$1:A$99,""))Returns lowest date or lowest order number.
I need the order number associated with the earliest date
This should do it:
=INDEX(A1:A10,MATCH(MIN(B1:B10),B1:B10,0))
Used sample range for orders A1:A10 and dates B1:B10. Just change accordingly.

How can I select a specific cell value filtering with the nearest date (in a column) to select a specific row?

I am very new in Excel and I have to implement this pretty complex task (at least for me it is complex).
I put what I am doing here: https://drive.google.com/open?id=1sWHbyl-Y-GgSiX7JJ3bJ9_y8DUts-E0e
I will try to explain exactly what I have to do:
For each rows I have to "calculate" the value of the L column in this way.
Each cell into the L column is "calculated" using the following steps:
Considers the date into the H column of this row.
Search the nearest date in the past into the A column to select a specific row.
Take the E column value of this row and use it to populate the current L cell.
So doing a practical example, I want to populate the L3 cell, I have to do:
Considers the date into the H column of this row: so I obtain the value of the H3 row that is this date: 16/12/2017.
Then, into the whole A column I search the nearest date in the past in this column (in this case it is 15/12/2017), so I select the row number 4.
Take the value of E4 cell value (598,05 €) and write it into my L3 cell.
How can I do something like this?
Thank you
This is a simple INDEX(...,MATCH()) situation.
=INDEX(E:E,MATCH(H3,A:A,1))
This will return the value in column E such that the date in column A is the greatest date less than or equal to the value in H3.
Note: This assumes the dates in column A are sorted in ascending order.
VLOOKUP:
=VLOOKUP(H3,A:E,5,TRUE)
This requires the dates in Column A to be sorted.

Sum of values for a given week

I have a sheet that is tracking the cost of transactions ordered by date. This is how it looks so far:
I would now like to add another column that has the Weekly Totals (Monday - Sunday) printed in the last row for each Sunday. How can this be done?
I have tried this formula so far:
=IF(AND(WEEKDAY(A2)=0,A2<>A3),SUMIF(A:A,AND(<=A1>=A1-6),B:B))
but it is the use of two criteria in the SUMIF that has me lost.
I think the following formula is what you need:
=IF(AND(WEEKDAY(A2)=1,A2<>A3),SUMIFS(B:B,A:A,">="&(A2-6),A:A,"<="&A2),"")
Note that the SUMIFS function is used to handle the multiple IFs, as opposed to the SUMIF function.
The IF function uses the AND function to test two conditions:
Is the WEEKDAY number equal to 1? (e.g., is this row for a Sunday?)
And is the current row's date non-equal to the next row's date? (e.g., is this the last row for the date?)
If either of the above are false, then the formula returns an empty string, "". If both of the above are true, then it sums the values in column B if the following two conditions are both met:
The value in column A is greater than or equal to the value of the current date minus 6 days.
The value in column A is less than or equal to the value of the current date.

Resources