Forum Discussion
FINDING TOTAL NUMBER OF DAYS
- Jan 02, 2021
On the basis of illustration by you above and what I've realized, trying to solve the issue, check the attached file and let me know whether is working or not!!
Thanks for replying Rajesh-S. I think that may be my biggest problem...not doing a very good job of describing what I want. I just found out that OMAS- file was incorrect, so I corrected it and uploaded it in my original post, so if you downloaded my original file, please download the updated file. I will try to explain what I am trying to accomplish:
in cell K2 of 12-01- :
SYMBOL = A; H2 is less than I2, so if B2+1 (116.36 or higher) is found in Column D in OMAS-, which it is in cell D6 (116.44), I take the date in G6 and subtract G1 from 12-01-, thus 12/07 - 12/01 = 6 days, which goes in K2.
Does this make it any clearer? Please advise me of which part you are having difficulty understanding and I will try my best to explain it. Also be advised that the original OMAS file is over 287K and the 12-01 file is 676 rolls. I don't know if that will make any difference or not.
On the basis of illustration by you above and what I've realized, trying to solve the issue, check the attached file and let me know whether is working or not!!
- SkytalkerJan 03, 2021Copper Contributor
Thanks a lot for spending your time trying to solve my problem. I was trying to use helper columns also, but I just couldn't get my formulas to work correctly. You ALMOST understand what I was trying to accomplish, but not quite:
L2 is correct. If H2 is lower than I2, I want to buy stock, BUT I want to see how many days it took for the stock to reach benchmark, i.e., 116.36 = 1, 117.36 = 2, 118.36 = 3, etc. Once the stock got above 116.36, which occurred on 12/7, I want to subtract 12/7-12/1 (G2), which is 6. Once it got above 117.36, which it did on 12/20, it would be 9 (G9-G2), etc.
I like what you did in O2, =IFERROR(DATEDIF($G$2,N2,"d"),""). I'm going to see if I can find my old files with my helper columns and see if I can get it to work with them. If you are still confused, please do not hesitate to ask me.
Again, thanks so much for taking time out of your day to help.
- Rajesh_SinhaJan 05, 2021Iron Contributor
Glad to help you,,, I've tried my best to understand data illustration and your need and applied the possible method/formula. Furthermore I would like to suggest create one small but meaningful compact sample data and below it show me your expected result, I'll try one more time to fix it, keep asking ☺
- SkytalkerJan 05, 2021Copper ContributorRajesh, Did you attach a file to show me what you accomplished?
- SkytalkerJan 05, 2021Copper Contributor
I was able to find some earlier work that I had thought I had lost when my laptop crashed when I dropped it, but I was able to find it and rebuild it. Anyway, I hope you can understand what I am trying to accomplish and can help.