Formula to check data contingent on multiple constraints

Status
Not open for further replies.

Dennisss11

New Member
Joined
Nov 25, 2022
Messages
9
Office Version
  1. 365
Platform
  1. MacOS
Hi all,

I am struggling to find a formula that returns exactly what I need to filter my data. In the mini-sheet below there is a simplification of the data. For the real data set, there are over 450k rows that need to be checked. However, a formula that is working in the mini-sheet should also work on the full set (I think).

For every specific date, the formula should check the following:
- Is there a "C" and a "P" entry available. If not, those dates should return "". As seen in row 23 and 26 (which I highlighted orange) on these dates there is only either a "P" available or only a "C" respectively.
- If there is a "C" and "P" entry, it should find the "C" closest to number stated in AP6 and the "P" entry closest to number stated in AO6.
- The result should be in column AQ as shown. So every date that matches the first requirement, gets only one "C" entry that we "Keep" and one "P" entry that we "Keep".

Hopefully it is clear what I am trying to accomplish. Thanks in advance for taking the time!

All Sell 1DTE.xlsx
AMANAOAPAQAR
4
5PutCall
6Preferred Delta (closest to) -0.20.2
7
8Raw DataFormula needed
9DatePut/CallDeltaCheck
107/23/15C0.44
117/23/15P-0.44
127/23/15C0.33
137/23/15P-0.33
147/23/15C0.21Keep
157/23/15P-0.21Keep
167/23/15C0.11
177/23/15P-0.11
187/24/15C0.23
197/24/15P-0.23
207/24/15C0.19Keep
217/24/15P-0.19Keep
227/24/15C0.99994
237/25/15P-0.21
247/26/15C0.4Keep
257/26/15P-0.4Keep
267/27/15C0.19
277/29/15C0.001
287/29/15P-0.001
297/29/15C0.8
307/29/15P-0.8
317/29/15C0.2
32
Sheet1
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Status
Not open for further replies.

Forum statistics

Threads
1,215,139
Messages
6,123,264
Members
449,093
Latest member
Vincent Khandagale

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top