Excel – Count only instances of unique values in two columns

Please see image below, I am looking to populate cells G8-G12 with a value of how many times the day appears in Column B and has a unique date in Column A. So as an example, Wednesday would count 2 as it appears on 28/02/2024 and 06/03/2024. How do I do this? I’ve tried SUMPRODUCT… Read More Excel – Count only instances of unique values in two columns

Collapse multiple columns into one column based on values in R

I have data.frame df1: df1 <- data.frame(apple = c(‘0’, ‘0’, ‘0’, ‘1’, ‘0’, ‘1’, ‘0’, ‘0’, ‘0’, ‘1’), banana = c(‘1’, ‘0’, ‘0’, ‘0’, ‘1’, ‘0’, ‘1’, ‘0’, ‘0’, ‘0’), cherry = c(‘0’, ‘1’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ‘1’, ‘0’, ‘0’), date = c(‘0’, ‘0’, ‘1’, ‘0’, ‘0’, ‘0’, ‘0’, ‘0’, ‘1’, ‘0’)) rownames(df1)… Read More Collapse multiple columns into one column based on values in R

Using R to split a structured string into multiple columns and set column names based on string values

I have a column of character string with each row containing information for multiple columns, including the column names. Every cell is structured so one can easily see the different pieces of information, but it is not easy to work with in this format. A cell is formatted like ‘variable: value’, with multiple inputs separated… Read More Using R to split a structured string into multiple columns and set column names based on string values

How to add columns with the same name into last line in order to have only one column pandas

There is a dataframe that contains several columns with the same name and I don’t know the exact number of columns with the same. I want to keep only one column on my dataframe and add the the values of the other to the last line. I don’t know the best way to proceed. Simple… Read More How to add columns with the same name into last line in order to have only one column pandas