Results 1 to 10 of 10

Thread: Excel Formula Advice Needed

  1. #1
    LUSE Galant's Avatar
    Join Date
    Oct 2003
    Location
    Gibraltar
    Posts
    3,252
    Thanks
    502
    Thanked
    555 times in 339 posts

    Excel Formula Advice Needed

    Hi guys,

    I need some help to figure out the formula to be used on an inventory sheet.

    I need to check if a certain value (text/numeric combo, eg. "POLP1003") appears in a specific column on several different sheets and then to return a value of "No data" if the value does not appear at all.

    The pseudo-formula I have so far is:

    =IF(OR('Active Service'!C:C=A6; Spare!A:A=A6; 'In Repair'!A:A=A6; Retired!A:A=A6),,"No data")

    (Where A6 is the cell containing the item name I am searching for)

    eg. A6 = "POLP1003" I want to check for that value in Column C in one sheet, Column A in the next worksheet, Column A in the third worksheet and finally Column A in the fourth worksheet. If that value does not appear in any of the worksheets, I need, "No data".

    As always, thanks for your help!
    No trees were harmed in the creation of this message. However, many electrons were displaced and terribly inconvenienced.

  2. #2
    Pork & Beans Powerup Phage's Avatar
    Join Date
    May 2009
    Location
    Kent
    Posts
    6,260
    Thanks
    1,618
    Thanked
    608 times in 518 posts
    • Phage's system
      • Motherboard:
      • Asus Crosshair VIII
      • CPU:
      • 3800x
      • Memory:
      • 16Gb @ 3600Mhz
      • Storage:
      • Samsung 960 512Gb + 2Tb Samsung 860
      • Graphics card(s):
      • EVGA 1080ti
      • PSU:
      • BeQuiet 850w
      • Case:
      • Fractal Define 7
      • Operating System:
      • W10 64
      • Monitor(s):
      • Iiyama GB3461WQSU-B1

    Re: Excel Formula Advice Needed

    I'm no expert but couldn't you use a COUNTIF function ?
    Society's to blame,
    Or possibly Atari.

  3. #3
    LUSE Galant's Avatar
    Join Date
    Oct 2003
    Location
    Gibraltar
    Posts
    3,252
    Thanks
    502
    Thanked
    555 times in 339 posts

    Re: Excel Formula Advice Needed

    How?

    I'm not sure COUNTIF provides the option to dictate a response depending on the result.

    I've tried this formula using COUNTIF: =COUNTIF(('Active Service'!C; Spare!A:A; 'In Repair'!A:A; Retired!A:A);A6)

    But it doesn't like at least one value in the formula.
    No trees were harmed in the creation of this message. However, many electrons were displaced and terribly inconvenienced.

  4. #4
    blueball
    Guest

    Re: Excel Formula Advice Needed

    I would use

    =IF(OR('Active Service'!$C:$C=$A$6,Spare!$A:$A=$A$6,'In Repair'!$A:$A=$A$6,Retired!$A:$A=$A$6),,"Not Found")

    The $ signs mean I can drag the formula around without losing the target cells.
    You need to separate the checking values with commas not semi-colons.
    Also I prefer "Not Found" to "No Data" as it is a more truthful answer
    Last edited by blueball; 31-10-2012 at 01:08 PM.

  5. Received thanks from:

    Galant (31-10-2012)

  6. #5
    LUSE Galant's Avatar
    Join Date
    Oct 2003
    Location
    Gibraltar
    Posts
    3,252
    Thanks
    502
    Thanked
    555 times in 339 posts

    Re: Excel Formula Advice Needed

    Okay, it doesn't like the commas, but if I divide them with semi-colons I then get a working formula - sort of. In my first test it returned the value "Not found" when it shouldn't have.

    =IF(OR('Active Service'!$C:$C=$A$6;Spare!$A:$A=$A$6;'In Repair'!$A:$A=$A$6;Retired!$A:$A=$A$6);;"Not Found")

    ???
    No trees were harmed in the creation of this message. However, many electrons were displaced and terribly inconvenienced.

  7. #6
    Seething Cauldron of Hatred TheAnimus's Avatar
    Join Date
    Aug 2005
    Posts
    17,168
    Thanks
    803
    Thanked
    2,152 times in 1,408 posts

    Re: Excel Formula Advice Needed

    Hard to really help without having the sheet or making a dummy one.

    If you also use Named Ranges it will make reading the formula a lot easier.

    The ; and , are due to localisation settings, I'm guessing your not using English
    throw new ArgumentException (String, String, Exception)

  8. #7
    Registered+
    Join Date
    Oct 2012
    Posts
    32
    Thanks
    2
    Thanked
    3 times in 3 posts

    Re: Excel Formula Advice Needed

    Not sure whether I entirely understand your problem but wouldn't something like this suffice?
    =IF(COUNTIF(Sheet2!B:B,A6)+COUNTIF(Sheet3!C:C,A6)<1, "not present", "")

  9. #8
    Registered+
    Join Date
    Oct 2012
    Posts
    32
    Thanks
    2
    Thanked
    3 times in 3 posts

    Re: Excel Formula Advice Needed

    You could also check whether a particular value existed is every column using:
    =IF(PRODUCT(COUNTIF(Sheet2!B:B,A6),COUNTIF(Sheet3!C:C,A6)),0)

  10. #9
    Member
    Join Date
    Aug 2006
    Posts
    198
    Thanks
    5
    Thanked
    14 times in 14 posts

    Re: Excel Formula Advice Needed

    Ctrl F then polp1003 with the search on the book rather than the sheet.

  11. #10
    LUSE Galant's Avatar
    Join Date
    Oct 2003
    Location
    Gibraltar
    Posts
    3,252
    Thanks
    502
    Thanked
    555 times in 339 posts

    Re: Excel Formula Advice Needed

    Thanks for your input guys. It's now solved. The solution was:

    =IF(OR(COUNTIF(Retired!A:A;'Births & Deaths'!A6)>0;COUNTIF('Active Service'!C;'Births & Deaths'!A6)>0;COUNTIF(Spare!A:A;'Births & Deaths'!A6)>0;COUNTIF('In Repair'!A:A;'Births & Deaths'!A6)>0);"Check Status";"Not found")


    PS - Looks like we need an option to disable smiley code. For C : D .
    No trees were harmed in the creation of this message. However, many electrons were displaced and terribly inconvenienced.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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