+ Reply to Thread
Results 1 to 16 of 16

Formula to return the cost amount relative to the number of Adults & Dependants in a house

Hybrid View

  1. #1
    Registered User
    Join Date
    08-19-2008
    Location
    Auckland, NZ
    MS-Off Ver
    2016
    Posts
    67

    Formula to return the cost amount relative to the number of Adults & Dependants in a house

    Please help. I need to write a simple formula that returns the cost amount relative to the number of Adults & Dependants in a household.
    The table in the attached excel page details the relevant data and I just need a simple formula that allows me to obtain the correct cost in cell B17 if the appropriate numbers of adults and dependants are entered in cells B15 & B16.
    Any help much appreciated. Thanks
    Attached Files Attached Files
    Last edited by whitepaw; 07-18-2019 at 08:06 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Simplified If / and formula or simple alternative

    Try this:

    =LOOKUP(2,1/(($A$2:$A$13=B15)*($B$2:$B$13=B16)),$C$2:$C$13)

    Then format the cell to match your cost cells.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-19-2008
    Location
    Auckland, NZ
    MS-Off Ver
    2016
    Posts
    67

    Re: Simplified If / and formula or simple alternative

    Thanks so much Ali, worked perfectly. Good luck against us (NZ) in the cricket tonight! haha

  4. #4
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Simplified If / and formula or simple alternative

    Try this:

    =SUMIFS(C:C,A:A,B15,B:B,B16)

  5. #5
    Registered User
    Join Date
    08-19-2008
    Location
    Auckland, NZ
    MS-Off Ver
    2016
    Posts
    67

    Re: Simplified If / and formula or simple alternative

    Thanks very much for this - it worked too!

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Simplified If / and formula or simple alternative

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

    Good luck to you Kiwis, too.

  7. #7
    Registered User
    Join Date
    08-19-2008
    Location
    Auckland, NZ
    MS-Off Ver
    2016
    Posts
    67

    Re: Simplified If / and formula or simple alternative

    Sorry Ali, one more question? Is it easy to amend your formula to provide for a greater number of adults / dependants? i.e. 2 or more adults, 5 or more dependants - or should I simply expand the database? I willmark the thread SOLVED on your reply.
    The cricket game was amazing - shame one team had to lose. Everyone in NZ is gutted!

  8. #8
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Simplified If / and formula or simple alternative

    Glad we could help. Thanks for the rep!

  9. #9
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Simplified If / and formula or simple alternative

    Tough luck on the cricket outcome - penalty shootouts are never really a nice way to have to finish - but we don't feel sorry for you at all.

    I would do it this way:

    Excel 2016 (Windows) 32 bit
    E
    F
    G
    H
    I
    J
    K
    1
    0
    1
    2
    3
    4
    5
    2
    1
    1,278
    1,533
    1,705
    1,815
    1,915
    2,005
    3
    2
    1,786
    2,021
    2,214
    2,304
    2,384
    2,464
    4
    5
    Adults
    2
    6
    Dependants
    6
    7
    Cost
    2464
    Sheet: Sheet1

    =INDEX($F$2:$K$3,MATCH(H5,$E$2:$E$3,1),MATCH(H6,$F$1:$K$1,1))

  10. #10
    Registered User
    Join Date
    08-19-2008
    Location
    Auckland, NZ
    MS-Off Ver
    2016
    Posts
    67

    Re: Simplified If / and formula or simple alternative

    Hi Ali, Many thanks for this, it works however, I tried to reformat the table as per attached sheet and the outcomes don't work. I suspect it has something to do with the first MATCH formula as instead if 1 & 2 being one below the other, they are now side by side! Is there an easy fix for this? Cheers
    NB – I tried to display my reformatted data in a table as you did but couldn’t manage to insert a table here!
    Attached Files Attached Files

  11. #11
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Simplified If / and formula or simple alternative

    That's why I reformatted the data.

    What is the problem with having the lookup table horizontally? It makes everything easier.

    EDIT: Forget that - I see what you've done.

    You need the vertical (row) reference first:

    =INDEX(F12:G17,MATCH(F20,E12:E17,1),MATCH(F19,F10:G10,1))

    Syntax:

    =INDEX(result_array,row,column)
    Last edited by AliGW; 07-17-2019 at 02:41 AM.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Simplified If / and formula or simple alternative

    Excel 2016 (Windows) 32 bit
    E
    F
    G
    10
    Adults
    1
    2
    11
    Dependants
    12
    0
    1,278
    1,786
    13
    1
    1,533
    2,021
    14
    2
    1,705
    2,214
    15
    3
    1,815
    2,304
    16
    4
    1,915
    2,384
    17
    5
    2,005
    2,464
    18
    19
    Adults
    1
    20
    Dependants
    2
    21
    Cost
    1,705
    22
    Sheet: 1


    Excel 2016 (Windows) 32 bit
    F
    21
    =INDEX(F12:G17,MATCH(F20,E12:E17,1),MATCH(F19,F10:G10,1))
    Sheet: 1

  13. #13
    Registered User
    Join Date
    08-19-2008
    Location
    Auckland, NZ
    MS-Off Ver
    2016
    Posts
    67

    Re: Simplified If / and formula or simple alternative

    Hi Ali, Thanks so much for the work you’ve done on this for me. It looks like you’ve put quite a bit of time into it and I really really appreciate it. I wish I understood a fraction of what you seem to know about excel!
    Regarding the cricket, congrats on your win but we’ll get you guys back in Japan in a couple of months! Cheers

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,053

    Re: Simplified If / and formula or simple alternative

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Simplified If / and formula or simple alternative

    Please would you update the thread title as requested in post #13, even though it's resolved? I confess I had not noticed that you had used a generic title, and I should have asked you to change it myself before we started.

    Please change it to this: "Formula to return the cost amount relative to the number of Adults & Dependants in a household".

    When this is done, please mark the thread as solved.

    I have learnt what I know about Excel over a long period, and much of that knowledge has come from involvement here.

    I'm sure we'll beat you again in Japan ...

  16. #16
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,919

    Re: Formula to return the cost amount relative to the number of Adults & Dependants in a h

    Thanks for changing the title.

+ 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] Can this formula be simplified?
    By Ray1971 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-04-2019, 04:36 PM
  2. [SOLVED] Simplified Version of This Formula?
    By Kogen in forum Excel General
    Replies: 3
    Last Post: 09-10-2018, 03:19 PM
  3. Overcomplicated VBA for Simple Formatting - Need alternative to Hide Rows
    By GoyaRU in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 08-15-2018, 10:40 AM
  4. [SOLVED] SUMIFS Formula to be simplified
    By Jexcel2012 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-20-2018, 01:13 PM
  5. [SOLVED] Suggest Simplified Formula
    By kundanlal in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-09-2016, 06:47 AM
  6. Write a simple Macro to delete every alternative rows (1, 3, 5...)
    By kwfine in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2011, 02:45 AM
  7. Can Formula Be Simplified?
    By natei6 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-31-2007, 04:56 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