# Help with proofreading the formula SUM(IF(FREQUENCY(IF...

#### virtuosok

##### Board Regular
Hi,
I am struggling with the below array formula as it returns a "too few arguments" error.
Excel Formula:
``=SUM(IF(FREQUENCY(IF('Medication log'!\$E\$13:\$E\$50000=C2,IF('Medication log'!\$H\$13:\$H\$50000,"Yes",IFERROR('Medication log'!\$F\$13:\$F\$50000+0, "")))),ROW(INDIRECT("44044:45100")))+FREQUENCY(IF('Reminder diary'!\$E\$13:\$E\$50000=C2,IF(‘Reminder diary’!\$S\$13:\$S\$50000,”Yes”,IFERROR('Reminder diary'!\$F\$13:\$F\$50000+0,""))),ROW(INDIRECT("44044:45100"))),1))``
Legend:
- analyzing data on Medication log - and on Reminder diary tabs, for cases when entries in column E matches entry in cell C2 on "main" tab
- the goal is to have total number of unique dates across both tabs (there may be partial overlap) for the condition in previous bullet; dates are listed in column F on both tabs
- at the same time, these unique dates must only be counted when there's also a "Yes" in column H in Medication log tab, or "Yes" in column S in Reminder diary tab. Otherwise these dates should be ignored in overall calc.
What am I doing wrong please?

#### Fluff

##### MrExcel MVP, Moderator
Your formula is looking at col S on the Medication Log sheet, but that's blank. Should it be looking at H?

### Excel Facts

Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.

#### virtuosok

##### Board Regular
Oh yes, indeed, by changing to H the formula works! Thanks you BOTH, I know the references to different columns in different tabs did not help to simplify the case.

#### Fluff

##### MrExcel MVP, Moderator
Glad we could help & thanks for the feedback.

Replies
7
Views
99
Replies
3
Views
39
Replies
3
Views
104
Replies
2
Views
98
Replies
15
Views
272

1,130,318
Messages
5,641,501
Members
417,213
Latest member
wikk

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back