I am programing a Google Sheet to summarize data from another Google Sheet.
The sheet containing data is called "Sales"
In the sales sheet, each row represents a sale. It has columns for sales rep name (G column), date of sale (N column), sales class (V column), and Working Days (W column).
I'm trying to write a formula for the following logic.
Calculate Median (working days) from column W values of rows that equal ...
sales rep = "Jane Doe",
sale date is between Jan 1, 2020 and December 31, 2020,
sale classification = "1"
Here is the function I have so far...
=MEDIAN(Sales!W:W,(if(Sales!G:G,"Jane Doe",Sales!N:N,">=1/1/2020 00:00:00", Sales!N:N,"<=12/31/2020 23:59:59",Sales!V:V,"1")))
I get an error with the above code. Any idea how to do this?