+ Reply to Thread
Results 1 to 20 of 20

Comparing current price to previous price and sum total - spreadsheet example

  1. #1
    Forum Contributor
    Join Date
    10-11-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    358

    Comparing current price to previous price and sum total - spreadsheet example

    I've attached a spread-sheet example of the problem.

    This is what I am trying to do and can be a little complex so I'll break down steps:

    1) Is F4 > F3? - If TRUE go to question 2.

    2) Is F4 - F3 equal J2? - If TRUE go to question 3.

    3) Is F5 < F4 ? - If TRUE Sum Total in corresponding row 3 and column "Pips". (example is green box)


    If question 3 was FALSE i want a sub total of the number of falses in the corresponding red box (e.g. red box highlighted).


    All of the above is written within the attached spreadsheet.

    Thanks in advance for your help!!
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    07-07-2014
    Location
    Washington DC
    MS-Off Ver
    2007
    Posts
    1,047

    Re: Comparing current price to previous price and sum total - spreadsheet example

    I was unable to identify any row meeting all 3 criteria.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    10-11-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Comparing current price to previous price and sum total - spreadsheet example

    UPDATE!

    Disregard what I have previously written if you read it. That was incorrect.

    I have made a video to make it clearer: http://screencast.com/t/Xva68k3BaaN
    Last edited by domgilberto; 10-17-2014 at 01:20 PM.

  4. #4
    Forum Contributor
    Join Date
    10-11-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Comparing current price to previous price and sum total - spreadsheet example

    Anyone have any bright ideas

    Would massively appreciate help

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,914

    Re: Comparing current price to previous price and sum total - spreadsheet example

    see attached file
    Attached Files Attached Files
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing current price to previous price and sum total - spreadsheet example

    I found the explanations somewhat confusing because I couldn't exactly picture how all the requirements would be met. This may not solve your problem but may give an idea, if on the right track, of how to solve it.

    I used two helper columns. The first one, column I determined if f4>f3 and f4<f5 if both were TRUE, subtracted F3 from F4.

    The second helper column, column I determined if F4 < F3 regardless of other conditions as I could not determine just how that was to be applied to the values in J3 to N3. Where this was TRUE a 1 was entered in column I. The helper columns are in yellow. The calculations for each of the values in J3 to N3 are in J4 to N4.
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  7. #7
    Forum Contributor
    Join Date
    10-11-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Comparing current price to previous price and sum total - spreadsheet example

    Looks incredible!

    I'll need to look at it in greater detail little later on. Looks spot on from the surface though.

    Is it possible to have below the red boxes where by "criteria 3" I mention in the video was false and record the sum total of that BENEATH the red box?

    I want to know a percentage of ones that close price was < qualifying criteria 1 & 2 against close price > qualifying criteria 1& 2

    Thank you!

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing current price to previous price and sum total - spreadsheet example

    What solution are you referring to?

    What exactly are the calculations that you are after? I found both presentations to be somewhat hard to understand what you want.

  9. #9
    Forum Contributor
    Join Date
    10-11-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Comparing current price to previous price and sum total - spreadsheet example

    Quote Originally Posted by newdoverman View Post
    What solution are you referring to?

    What exactly are the calculations that you are after? I found both presentations to be somewhat hard to understand what you want.
    Just glanced at what you've done and my response was to nflsales.

    Without comparing the two spreadsheets you've kindly done - and glancing briefly at what you've done newdoverman - yours looks pretty much spot on for what I am after.

    Using what you have kindly done to help me, I have made tiny changes to help explain further what I am actually wanting to gain from this spread-sheet. As this spread-sheet currently stands in this version, everything is what I am after minus one more thing (pretty much).

    Please see attached.
    Attached Files Attached Files
    Last edited by domgilberto; 10-19-2014 at 09:50 AM.

  10. #10
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing current price to previous price and sum total - spreadsheet example

    I think that I have interpreted what you want. You should now be able to calculate the percentages that you want.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    10-11-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Comparing current price to previous price and sum total - spreadsheet example

    Yes that is pretty much spot on! Last little change is this: http://screencast.com/t/1uxFFCLv

    Thank you so much for your time! You always nail it!

  12. #12
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing current price to previous price and sum total - spreadsheet example

    You say that you want to "flip". I'm not sure exactly how you want this done.

    This is the main statement that get repeated throughout the formula: IF(AND($F4>$F3,$F4-$F3>=$P$2,$F5>$F4),"Failed Pips 0.0011"

    What you refer to as "Brown" is F5

    What you refer to as "Green" is F3

    What you refer to as "Blue" is F4

    I don't really understand what you need to be "flipped" and would appreciate a clarification.

    This will require an additional helper column as it cannot be included in column J. This file has made provision for that additional column and changes have been made to the formula in column J so that it can be used, with the modifications that you want.

    The enclosed file isn't the last part solution but the groundwork.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    10-11-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Comparing current price to previous price and sum total - spreadsheet example

    My apologies, that was very vague of me! I've uploaded the slight changes made to your formula's here. This is pretty much what I needed from here. I've got lost in my own explanations now I'm starting to confuse myself! So ignoring above I'll start again below:

    In new spread-sheet the greyed out area is illustrating that formula's are not required here as there needs to be at least 3 Close numbers in order to make up a formula. Therefore, the formula starts from row 5.

    Everything I have done to the formula's are pretty much correct accept for one thing I am not entirely sure is accurate.

    In row column "J", when checking the "Pip" difference (i.e. 0.0003) it's saying:

    ...IF(AND(F4>F3,F4-F3 >= K$2,F5>F4),"Failed Pips 0.0003",""...

    Should the equality be equal to or greater than? How can I say equal to or greater than BUT less than 0.0005? Same for all Pips...?
    Attached Files Attached Files

  14. #14
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing current price to previous price and sum total - spreadsheet example

    The part of the formula that you quote is correct for the part of the formula that it is found in. The difference F4-f3 is being compared to the minimum value for Pips 0.0003

    You will notice if you follow the formula from beginning to end that it is progressively comparing that difference to the minimum value for the Pips. All the minimum Pip values in descending order. This determines if the value calculated is between one Pip and another.

    If you were to add the less than 0.0005 to the conditions, you would be eliminating all values pertaining to the Pips with values greater than 0.0005. The IF(AND(.....) means that all the elements between the () must be TRUE for the statement to be correct. One element that is not TRUE will render the whole part FALSE. In this case, the calculations for all Pips with values greater than 0.0005 would be FALSE and nothing would be returned for them.

    That means that if you want to make a different statistical calculation, it will have to be in a column other than J because the added condition will be contradictory to what is already there. If all is correct up to column J and the values returned satisfy what you are looking for to that point then you have to decide exactly what it is that you are wanting to calculate that is not already included in the calculations. This would then be entered into column K and the summary of that can then be calculated under each Pip.

  15. #15
    Forum Contributor
    Join Date
    10-11-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Comparing current price to previous price and sum total - spreadsheet example

    Sweet thanks, I understand. It's perfect thank you as usual for helping me

    Wondering if you can help me with this formula: =IF(H18=0.0003,E17-E18,0)

    It's returning "0". I want it to return the true parameter: E17-E18 (this is now the spread-sheet with ALL the data and is too large to upload here) E column is "Close" and H column is 0.0003 (e.g.). So same layout as test spreadsheet we've been looking at on here but just moved lower.

  16. #16
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing current price to previous price and sum total - spreadsheet example

    If H18 does equal 0.0003 then the subtraction will take place. If H18 does not equal 0.0003 the result will be zero.

    =IF(H18=0 is the Logical Test. If the test is TRUE, then the TRUE part of the formula will be returned that is E17-E18. If the Logical Test is FALSE, 0 will be returned. If E17 or E18 or both have a non numeric value, a #VALUE! error will be returned.

  17. #17
    Forum Contributor
    Join Date
    10-11-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Comparing current price to previous price and sum total - spreadsheet example

    What am I doing wrong then: http://screencast.com/t/Hl8vig6QR ??

  18. #18
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing current price to previous price and sum total - spreadsheet example

    I think that H20 must be formatted as text before the number 0.0003 is entered. That is the only way that I can reproduce your problem.

    Delete the contents of H20. Format H20 as GENERAL and enter 0.0003 back into the cell. If H20 is being filled via formula multiply the formula by 1 or add 0, to change the formula result to a number.

  19. #19
    Forum Contributor
    Join Date
    10-11-2012
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    358

    Re: Comparing current price to previous price and sum total - spreadsheet example

    If i delete the formula in H20 you are right, it works. But I need formula to work. So I delete, reformat like you suggested, put the formula in and it still doesn't work. It just returns "0".

    What a stupid bug!?

  20. #20
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Comparing current price to previous price and sum total - spreadsheet example

    You are misunderstanding. The formula that you have in H20 is delivering what appears to be a number but it is really TEXT that looks like a number. All that you have to do is to append to the end of the formula a +0 or multiply by 1 to convert the TEXT to a NUMBER. Once converted to a number, both formulae will work just fine.

    If you are still having trouble after doing this, upload your worksheet and I will take a look at it for you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 10
    Last Post: 08-04-2014, 08:18 AM
  2. Total sold price according to stock price list
    By maniootek in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-26-2014, 10:54 PM
  3. Replies: 3
    Last Post: 01-03-2013, 12:32 AM
  4. [SOLVED] Define current price as a % based on a high / Low price
    By helpbitte in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-21-2012, 12:45 PM
  5. Replies: 4
    Last Post: 08-15-2012, 09:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1