+ Reply to Thread
Results 1 to 20 of 20

Find and report the first value over 6000 in a row

  1. #1
    Registered User
    Join Date
    12-23-2015
    Location
    birmingham
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Find and report the first value over 6000 in a row

    Hi All,

    New to the forums so apologies if this has been asked before - hopefully I can ask in a coherent way also!

    I have a sales sheet with months in the headers and accounts in the rows with the amount spent in the month in the middle.

    I want to find the first spend over £6000 for each account and ideally return the month that this spend happened to populate row G as per the below example:


    A B C D E F G
    1 Customer Jan 15 Feb 15 March 15 April 15 May 15 Sales target hit
    2 Company A £1254 £6001 £7589 £7854 £6524 Feb 15
    3 Company B £3254 £2452 £4251 £4587 £6854 May 15
    4 Company C £5654 £5874 £5432 £6432 £6584 April 15
    5 Company D £3254 £3524 £2547 £4584 £5215 N/A

    I have tried to do Match and Index to no avail. Initially i started by trying to return the first result above £6000 and then in the next cell doing a look up to the header however it keeps finding the last cell instead.

    This is the formula I've tried:

    =INDEX(BG96:CD96,MATCH(TRUE,INDEX(BG96:CD96>6000,0)))

    the array is the specific row im looking at however it seems to return a random number in the row and not the first. I then used another index match to return the header as couldn't work out how to find the first greater than £6000 number and return the header in one formula.

    Any help would be greatly appreciated,

    Many Thanks,

    Laura

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Find and report the first value over 6000 in a row

    Hi.

    Use an exact match_type parameter:

    =INDEX(BG96:CD96,MATCH(TRUE,INDEX(BG96:CD96>6000,0),0))

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    12-23-2015
    Location
    birmingham
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Find and report the first value over 6000 in a row

    Thanks for your reply however this hasn't worked I'm afraid.

    I have attached an example of my spread sheet to better communicate my problem. As you can see there are many occasions where it is over £6000 but not returned. The forumla im looking for is in columns Z and AA

    Thanks in advance,

    Laura
    Attached Files Attached Files

  4. #4
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Find and report the first value over 6000 in a row

    Can you give me an example of a row in here where there is a value greater than £6,000 yet no value is returned by the formula?

    Regards

  5. #5
    Registered User
    Join Date
    12-23-2015
    Location
    birmingham
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Find and report the first value over 6000 in a row

    Yes, I used a conditional format on the attachment to show all values over £6000. Only one is returned at the moment.
    Attached Files Attached Files

  6. #6
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Find and report the first value over 6000 in a row

    Ah. I see. Blanks are being considered here as ">6000".

    Try:

    =INDEX(BG96:CD96,MATCH(TRUE,INDEX(0+BG96:CD96>6000,0)

    Regards

  7. #7
    Registered User
    Join Date
    12-23-2015
    Location
    birmingham
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Find and report the first value over 6000 in a row

    that returns the last cells with a value in it for some reason. Is it because my array is a row and not a list?

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Find and report the first value over 6000 in a row

    Try this one

    Fr the example provided on your spreadsheet.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  9. #9
    Registered User
    Join Date
    12-23-2015
    Location
    birmingham
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Find and report the first value over 6000 in a row

    This works for the first row but when i drag it down it seems to bring hte wrong result for some reason. Is it hte way im dragging it down?

    I have re- attached the spread sheet with this formula in there,

    Thanks again for all your help!
    Attached Files Attached Files

  10. #10
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Find and report the first value over 6000 in a row

    Quote Originally Posted by lctwigg View Post
    that returns the last cells with a value in it for some reason. Is it because my array is a row and not a list?
    Can I see an example in a workbook of this?

    Regards

  11. #11
    Registered User
    Join Date
    12-23-2015
    Location
    birmingham
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Find and report the first value over 6000 in a row

    Hi XOR LX,

    I have copied your previous formula into the attached spread sheet.

    Again, appreciate your help
    Attached Files Attached Files

  12. #12
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Find and report the first value over 6000 in a row

    Quote Originally Posted by lctwigg View Post
    This works for the first row but when i drag it down it seems to bring hte wrong result for some reason. Is it hte way im dragging it down?

    I have re- attached the spread sheet with this formula in there,

    Thanks again for all your help!
    No sure what exactly you talking about. All results show the first value that is greater than 6000. Or maybe you expect all values that are greater than 6000 appear in one cell?

  13. #13
    Registered User
    Join Date
    12-23-2015
    Location
    birmingham
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Find and report the first value over 6000 in a row

    Sorry it doesn't, Z5 returns 6716(J5) when it should return 7967(G5) and Z20 should return 7980 (J20) but returns N20 6761. It looks to me that its returning the smallest value over £6000 not the first in the row.

  14. #14
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Find and report the first value over 6000 in a row

    Your original post in this thread:

    Quote Originally Posted by lctwigg View Post
    I want to find the first spend over £6000 for each account

  15. #15
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Find and report the first value over 6000 in a row

    Quote Originally Posted by XOR LX View Post
    Ah. I see. Blanks are being considered here as ">6000".

    Try:

    =INDEX(BG96:CD96,MATCH(TRUE,INDEX(0+BG96:CD96>6000,0)

    Regards
    Sincere apologies. Having a bad day. Now I've missed off the additional zero that I previously advised you about:

    =INDEX(B2:Y2,MATCH(TRUE,INDEX(0+B2:Y2>6000,0),0))

    Regards

  16. #16
    Registered User
    Join Date
    12-23-2015
    Location
    birmingham
    MS-Off Ver
    MS Office 2013
    Posts
    12

    Re: Find and report the first value over 6000 in a row

    This works a dream, thank you

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

    Re: Find and report the first value over 6000 in a row

    The blanks in the worksheet are not blanks but contain something that doesn't return a code and is invisible. After deleting the contents of the "blank" cells, this works
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    There are 7565 of those mystery cell contents.
    You can get rid of the mystery contents by selecting B2 and copy. Hit escape. Go to Find and Select, Replace, click in the find what and Ctrl + V (shortcut for paste) enter something like ZZ in the Replace With field. Then click replace all. Now in the Find What field enter ZZ and in the Replace with field delete all contents and replace all.
    Attached Files Attached Files
    Last edited by newdoverman; 01-04-2016 at 01:47 PM.
    <---------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

  18. #18
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Find and report the first value over 6000 in a row

    @Ron

    Perhaps, but that formula will fail if those "blanks" are the not-so-mysterious, good old null string ("") as well, since Excel considers:

    ="">6000

    to be TRUE.

    Regards

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

    Re: Find and report the first value over 6000 in a row

    @XOR LX those could be "" as they don't register when using CODE to get what is in the cell or even if one used in =CELL X= CHAR(34) to get a TRUE/FALSE return. There weren't any formulae in those cells and if you just type "" into a cell they are visible and will return a value 34 for CODE. The values must be a "dump" from somewhere else if the contents are indeed "" as a copy of a cell with a null value and past values of that copy will produce invisible results without a formula being present.

    Whatever it is, I don't think that it should be allowed to continue in a worksheet that is in use because of the potential problems (as we found out with the multiple failed attempts at finding the correct values) that were caused.

  20. #20
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Find and report the first value over 6000 in a row

    Totally agreed with you that this should be rectified: nobody should leave such characters lurking within a spreadsheet.

    I was merely wishing to emphasize to potential readers of this thread the fact that the more innocent and common character that is the null string will also cause problems to "standard" solutions here which involve a comparison to numeric values (e.g. >6000).

    Regards

+ 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. Agging report, openingbalance report,customer report vab code was not working
    By rana19 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-28-2015, 03:38 AM
  2. Replies: 4
    Last Post: 08-18-2015, 10:02 AM
  3. [SOLVED] Subtracting all data for just say 30 entries from say 6000 entries
    By Mary22 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-19-2015, 09:34 AM
  4. Two spreadsheets, one is 6000 long the other 800. I need to find the 800 in the 6000
    By ELIVERGARA in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-26-2014, 06:48 PM
  5. Delete all rows with formulas from row 6000 and lower
    By timmyjc18 in forum Excel General
    Replies: 0
    Last Post: 06-27-2012, 08:18 PM
  6. Find highest value and report a different name
    By kmathie1 in forum Excel General
    Replies: 3
    Last Post: 01-09-2007, 06:05 PM
  7. [SOLVED] Can't find Report Manager in XP
    By Ant in forum Excel General
    Replies: 6
    Last Post: 11-10-2005, 02:40 PM

Tags for this Thread

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