Solved

Find the 2 Lowest of 3 numbers, nested If statement

Posted on 2013-07-01
5
270 Views
Last Modified: 2013-07-01
Hi,

I had a request to change how I was figuring out skin measurements in a physical test. There is a minimum of 2 measurements and possibly a 3rd (If you don't fall within 1 cm from the 2nd and 1st measurement, they measure a 3rd time). If there are 2 measurements (using my count formula), then I need to take the average of those 2 numbers. If there is a count of 3 measurements, I need to take the 2 lowest measurements and average the 2.

I came up with this, but I think the small() is incorrect. It looks like it is returning the 2nd smallest number, not the lowest and 2nd to lowest numbers.

'=IF(A2<>"",IF(J2=2,AVERAGE(A2:B2),IF(J2=3,AVERAGE(SMALL(A2:C2,2)),"")))

Thanks for any  help! Brent
EE-find-the-two-lowest-numbers.xlsx
0
Comment
Question by:bvanscoy678
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39292029
Use this formula:

=IF(COUNTA(A2:C2)=2,AVERAGE(A2:B2),AVERAGE(SMALL(A2:C2,1),SMALL(A2:C2,2)))

Kevin
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
ID: 39292032
It turns out that SMALL ignores blank cells so this works too:

=AVERAGE(SMALL(A2:C2,1),SMALL(A2:C2,2))

Kevin
0
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
ID: 39292035
This formula will display blank if there are only one or no measurements:

=IF(COUNTA(A2:C2)>1,AVERAGE(SMALL(A2:C2,1),SMALL(A2:C2,2)),"")

Kevin
0
 

Author Comment

by:bvanscoy678
ID: 39292039
The last one is perfect! I can eliminate one of my columns and merge the two. Thank you for the quick response!

Brent
0
 

Author Closing Comment

by:bvanscoy678
ID: 39292041
thanks!
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question