What is the best way to update the match formula to conditionally format? - excel

=MATCH(C$13, 'Vacation - Holiday'!$B:$B, 0)
C13 is the date 01/01/2016.
I am using this formula to conditionally format a cell in a calendar dashboard. It works great but I need the lookup array to be dependent on the name listed in cell B15.
Can I use AND(Match())? I have tried many things and feel so close but so far.
"Meg" is the header of the "B" column on sheet 'Vacation - Holiday'!$B:$B. There are names in columns A - J.
A B C D E F G H
1/1/2016 1/4/2016 1/5/2016 1/6/2016 1/7/2016 1/8/2016
Meg

The formula you want is:
=ISNUMBER(MATCH(C$13,INDEX(Sheet6!$A:$J,0,MATCH($B15,Sheet6!$1:$1,0)),0))

Related

If function and Xlookup

I am currently trying to run an excel function that runs the logic that if the cell that has date X is greater than date 2023-01-01 then run an XLookup function. If it is not then do not run it.
Here's what I tried below:
=IF(table2!N5>DATE(2023,1,1),XLOOKUP(A2,'Table2'!A:A,'Table2'!B:B),"FALSE")
N5 has the date 2022-12-01. The rest is just a standard xlookup function that would run if cell N5 is greater than the date 2023-01-01.
Data for the Xlookup below:
Table 1 : This table provides the lookup value A1.
A B C
1 Position Classification Full Name
2 111111 IT 04 John Smith
Table 2 : This table provides the lookup array being A:A and the return array being B:B
A B C D
1 Employment Position CC Valid From Valid To
2 111111 8888888 2022-10-01 2023-03-31
As posted in comments, I will suggest you use a cell reference, so it becomes more dynamic to use, instead of hard coding within a formula,
• instead of this
=IF(N5>0+"2023-01-01",XLOOKUP(E3,H:H,J:J),"FALSE"))
• Use a cell reference, let's say cell A1 = 2023-01-01
=IF(N5>A1,XLOOKUP(E3,H:H,J:J),"FALSE"))
So the above helps you in changing the cell A1 values whenever you need instead of bothering the formula each time for a change.
I would advise you to use the DATE() function, like this:
= IF(A1>DATE(2023,1,1), ...)

Number occurrences in another cell (Excell) [duplicate]

I have simple problem, but I've not be able to get an answer from searching. I require a column to calculate the number of the nth occurrence of a value. It's best explained in this picture
I require a method to calculate column B.
I'd be very grateful for any help.
Are you looking to merely provide a count of the distinct entries of column A in column B? Or merely add a formula to come up with the table in your link?
If the latter, then the formula to write in cell B2 is:
=COUNTIF(A$2:A2,A2)
then copy/paste it down column B. Note - if your data is both a Date and Time, but the cell is formatted to only display a date, you may not get the results you want. You'd need to interject a new column with a "floor" calculation to round the date/time value to a date (Excel date times are decimal, with integer part dictating the date, and remaining 0.0 -> 1.0 dictating the time of day)
If you just want to derive a table of the counts of distinct entries in column A, then a pivot table will do this for you - simple add a pivot table to cover the data in column A, then select column A into the rows category, and then also drag it into the values category, ensuring the field is set to "Count of". You should then have a table with the distinct entries in your data set in one column, and the count of their occurrences in the other column.
You can use the COUNTIF worksheet function, with a relative address.
Eg. In cell B2, enter this formula:
=COUNTIF(A$2:A2,A2)
And then fill-down.
Use the following formula to generate the required series:
=COUNTIF($A$1:A1,A1) and strech(copy) it in all the cells
This will generate result like this:
A 1 COUNTIF($A$1:A1,A1)
A 2 COUNTIF($A$1:A2,A2)
C 1 COUNTIF($A$1:A3,A3)
C 2 COUNTIF($A$1:A4,A4)
B 1 COUNTIF($A$1:A5,A5)
B 2 COUNTIF($A$1:A6,A6)
A 3 COUNTIF($A$1:A7,A7)
C 3 COUNTIF($A$1:A8,A8)
D 1 COUNTIF($A$1:A9,A9)
D 2 COUNTIF($A$1:A10,A10)
D 3 COUNTIF($A$1:A11,A11)
D 4 COUNTIF($A$1:A12,A12)

Sum with dynamic condition

I have an Excel file in which some columns. The Excel is my bank account.
The D column is date, and not just for one day,its the days of a week.
I want to some all columns in that has the same date, and insert it in new cell.ex : for a week i should have 7 sum.
Here is some possible data from the sheet.
date(Column D) Money(Column K) Sum of same date(Column N)
1396/1/1 2300
1396/1/1 1000 3300 // some of the same date
1396/1/2 1200
1396/1/2 320 1550 // some of the same date
It is possible with Excel functions? Does I need a subroutin?
In L2 try,
=IF(ROW()=MATCH(D2, D:D), SUMIFS(K:K, D:D, D2), TEXT(,))
Fill down.
Use this formula:
=IF(D2<>D3,SUMIF(D:D,D2,K:K),"")
Then copy down
Hey you need to work with Sumif or SUMIFS and your Formula should like,
SUMIFS(D2:D10, C2:C10,">="&TODAY()-7, C2:C10,"<="&TODAY())
Or it should be like,
=SUMIFS(D2:D10, C2:C10,">="&A2, C2:C10,"<="&A3)
Or
=SUMIF(D2:D10, C2:C10,">="&TODAY())
NB: Sum Range is D2:D10 & C2:C10 is Criteria range.
In 2nd example A2 & A3 Cells holds Date value.
Suppose your Dates are in Col A & you want to Sum values in Column B, so instead of Sumif you can use this,
C2=SUMPRODUCT(--(MONTH(A$2:A$10)=ROW()-1),--(B$2:B$10))
NB: MONTH function will pull the Month value from A2 and add with corresponding Cell value in B, drag the formula below.

How to set column conditionally in Excel?

I have been working on a spread sheet for work for about a week and a half now and have been stuck in the same place. I am working on something for payroll purpose. So A1 would have an employee name as would the rest of the column. B2 would have that specific employees hours worked.
for example.
A B
1 Doe, John C 6.65
I need a formula that will automatically move anyone that has hours greater than 0 to column E, along with their worked. hours.
If you want the name in column E and the worked hours in column F then set E1 to
=IF(B1>0,A1,"")
and set F1 to
=IF(B1>0,B1,"")
If you want the name and worked hours both in column E then set E1 to
=IF(B1>0,CONCATENATE(A1," ",B1),"")
and copy down the column.
IF(condition, expression if true, expression if false) allows you to set cells based on a logical condition. CONCATENATE allows you to join the contents of multiple cells (or expressions) together as a string.

Count 'Yes' from column K where year is 2014 in column B?

I am trying to create an excel formula which will count all of the occurrences of the word 'Yes' in my column K where the year of the date in column B is '2014'.
Column B Column K
01/02/2014 Yes
03/04/2014 No
06/01/2014 Yes
08/02/2015 Yes
So I know how to get the year from my date in column b
=YEAR(B:B)
But now I want to combine this and put it into a countif formula which will count all of the yes's in my column k where the year in column b is 2014.
here's what I've tried to put together:
=COUNTIF(K:K="Yes",YEAR(A:A)=2014))
This doesn't work, please can someone show me where I'm going wrong.
Try this:
=SUMPRODUCT(--(YEAR($A$2:$A$5)=2014),--($B$2:$B$5="Yes"))
To make it more dynamic, i.e.: get the criteria from the matching row data, change the formula to this:
=SUMPRODUCT(--(YEAR($A$2:$A$5)=YEAR(A2)),--($B$2:$B$5=B2))
EDIT:
Maybe this is what we need, paste below formula to C2:
=SUMPRODUCT(--(YEAR($E$2:$E$5)=A2),--($F$2:$F$5=B2))
Maybe not the most elegant solution, but this would work :
Create 3rd column with formula : =YEAR(A2) & B2
And to get your count use : =COUNTIF(C2:C5; "2014Yes")

Resources