Hi, I have the following array formula:
[pre] {=IF($BK30=0,0,IF(ISERROR(MODE(IF('LASTPRICE!$C$1:$C$50000=$BF30,'LASTPRICE'!$G$1:$G$50000))),AVERAGE(IF('LASTPRICE'!$C$1:$C$50000=$BF30,'LASTPRICE'!$G$1:$G$50000)),MODE(IF('LASTPRICE'!$C$1:$C$50000=$BF30,'LASTPRICE'!$G$1:$G$50000))))} [/pre]
What it does:
Searches for the most common price in a data sheet. If a common price is not found (or if only 1 product with 1 price is found) it will give the average instead. (Mode will return an error if only 1 price or no common prices are found). So the average is there to avoid the #N/A.
Is there a simpler way to write a similar formula. My spreadsheet has hundreds of products so there are hundreds of iterations of this array formula and it takes a while to calculate.
Regards,
Nacky
[pre] {=IF($BK30=0,0,IF(ISERROR(MODE(IF('LASTPRICE!$C$1:$C$50000=$BF30,'LASTPRICE'!$G$1:$G$50000))),AVERAGE(IF('LASTPRICE'!$C$1:$C$50000=$BF30,'LASTPRICE'!$G$1:$G$50000)),MODE(IF('LASTPRICE'!$C$1:$C$50000=$BF30,'LASTPRICE'!$G$1:$G$50000))))} [/pre]
What it does:
Searches for the most common price in a data sheet. If a common price is not found (or if only 1 product with 1 price is found) it will give the average instead. (Mode will return an error if only 1 price or no common prices are found). So the average is there to avoid the #N/A.
Is there a simpler way to write a similar formula. My spreadsheet has hundreds of products so there are hundreds of iterations of this array formula and it takes a while to calculate.
Regards,
Nacky