+ Reply to Thread
Results 1 to 8 of 8

Lookup then sum

  1. #1
    Registered User
    Join Date
    02-03-2019
    Location
    brighton
    MS-Off Ver
    2010
    Posts
    3

    Lookup then sum

    Right so I'm trying to make a formula in cell B(&C): if cell A1 says one of two things, add 1 to the last number in B and if not, leave blank.
    Then do the same for cell A&C, if it says the other thing.

    If that's made no sense then here's a visual example
    a b c
    individual 1
    company 1
    individual 2
    individual 3
    company 2
    formula formula



    I've tried this so many times I'm now losing my mind and cant make heads or tails of the simplest things so stop me from going completely insane please

    If none of THAT made any sense, welcome to my world.
    Last edited by justj2; 02-03-2019 at 01:21 PM.

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Lookup then sum

    Please try at B1 and drag down

    =IF(A1="individual",COUNTIF(A$1:A1,"individual"),"")

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,734

    Re: Lookup then sum

    If your data starts on row 2 (with headers in row 1), put this in B2:

    =IF(A2="individual",MAX(B$1:B1,"")

    and in C2:

    =IF(A2="company",MAX(C$1:C1,"")

    Copy down as required.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    02-03-2019
    Location
    brighton
    MS-Off Ver
    2010
    Posts
    3

    Re: Lookup then sum

    While neither formula is wrong I think I've explained it badly, at least they're not quite showing the results I want.

    A1=individual = 1
    A2=individual = 2 {B1+1}
    A3=company = 1
    A4=individual = 3 {B2+1}
    A5=company = 2 {C3+1}
    A6=company = 3 {C5+1}

    a b c
    individual 1
    individual 2
    company 1
    individual 3
    company 2
    company 3

    I think I've just said the same thing twice so am not helping myself really.
    You can pretty much ignore this next bit. Just trying to word it out, might spark an idea in my head as much as anyone elses.
    IF A1 says "individual" then type number {next in sequence} else leave blank

    After more trying am currently settled on a countif as I'll likely hide rows B&C in the examples given, the data is being used elsewhere via a concatenate.

  5. #5
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Lookup then sum

    What's wrong with this?

    Untitled.png
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Lookup then sum

    In B2

    =IF($A2="Individual",MAX($B$1:$B1)+1,"")

    In C2

    =IF($A2="Company",MAX($C$1:$C1)+1,"")
    Then copy down.
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  7. #7
    Registered User
    Join Date
    02-03-2019
    Location
    brighton
    MS-Off Ver
    2010
    Posts
    3

    Re: Lookup then sum

    Quote Originally Posted by Bo_Ry View Post
    What's wrong with this?

    Attachment 609550
    It's working today?! Defo me being a complete idiot yesterday then. Cheers to everyone especially RO_Ry.
    I'll try to be less dimwitted in future

    Problem solved.

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Lookup then sum

    Happy to help

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] Lookup: Lookup employee id and return value in cell x basued on most recent start date
    By jekeith in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-21-2018, 12:56 PM
  2. Replies: 3
    Last Post: 08-23-2017, 07:04 PM
  3. Two Lookup and Return (Lookup the column, then lookup the row)
    By Branbran10 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-05-2015, 04:55 PM
  4. Replies: 4
    Last Post: 05-19-2015, 08:42 PM
  5. Replies: 3
    Last Post: 04-08-2014, 03:11 AM
  6. Replies: 2
    Last Post: 05-19-2013, 08:46 AM
  7. Replies: 7
    Last Post: 06-19-2011, 12:51 PM

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