corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » Excel question (array/multiple columns)


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author Excel question (array/multiple columns)
Matt L
Member

Registered: 17th Apr 06
User status: Offline
6th Jan 14 at 22:48   View User's Profile U2U Member Reply With Quote

Normally I would google this but I cant seem to find a decent answer.

basically I have the current formula (not as big also I have range names in there for each column but this is to get the idea).

{= Max (if(C2:C5="x",E2:E5:G2:G5:I2:I5)}


Basically I have data as follows


| c | d | e | f | g | h | I
1 | x |10 | 20 | 35 | 30 | 10| 20
2 | Y | 5 | 10 | 5 | 25 | 30 | 6

Basically I want the formula to return 30 not 35 which it is currently giving me (I assume its because I am using : in the formula so it is looking between column E + G so its picking up the 35??)

This make anysense? (ideally id prefer not to use code)

edit: trying to get example to format

[Edited on 06-01-2014 by Matt L]
evilrob
Premium Member

Avatar

Registered: 16th Mar 12
Location: Your mum's house
User status: Offline
6th Jan 14 at 22:56   View Garage View User's Profile U2U Member Reply With Quote

Upload your workbook somewhere and post a link. Remove any sensitive or proprietary data obviously.

I'm not sure what you're trying to do.
Dom
Member

Registered: 13th Sep 03
User status: Offline
6th Jan 14 at 23:40   View User's Profile U2U Member Reply With Quote

Surely you stick Max within the IF statement?

Eg, if you're attempting to get the max value of each row based on the Yes/No boolean then you'd do (returns zero if boolean is No/False) -
code:
=IF(C1="x",MAX(D1:I1),0)


Doing this gets you something like -


[Edited on 06-01-2014 by Dom]
evilrob
Premium Member

Avatar

Registered: 16th Mar 12
Location: Your mum's house
User status: Offline
7th Jan 14 at 00:00   View Garage View User's Profile U2U Member Reply With Quote

quote:
Originally posted by Dom
Surely you stick Max within the IF statement?

That would include rows marked as 'y' in the first column - as what you would be doing by putting the MAX inside the IF is saying, if 'x' exists in the first column, then return the MAX of range (E2:E5,G2:G5,I2:I5).

I think what he's trying to do is return the MAX of range (E2:E5,G2:G5,I2:I5) only taking into consideration rows marked 'x'.

i.e. he's trying to find the MAX of an array with non-contiguous rows and columns. This might do the job:

{=MAX(IF(C2:C5="x",E2:E5),IF(C2:C5="x",G2:G5),IF(C2:C5="x",I2:I5))}
evilrob
Premium Member

Avatar

Registered: 16th Mar 12
Location: Your mum's house
User status: Offline
7th Jan 14 at 00:07   View Garage View User's Profile U2U Member Reply With Quote


Matt L
Member

Registered: 17th Apr 06
User status: Offline
7th Jan 14 at 13:04   View User's Profile U2U Member Reply With Quote

Cheers Rob, I shall try that, didnt think to do it by column although I have a feeling this may slow the sheet down (already slow with it being an array formula).
evilrob
Premium Member

Avatar

Registered: 16th Mar 12
Location: Your mum's house
User status: Offline
7th Jan 14 at 13:27   View Garage View User's Profile U2U Member Reply With Quote

It *should* be faster because technically it's examining fewer cells than your original formula.

 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
what do you work as? corsa_godfather General Chat 88 1521
29th Jul 03 at 23:15
by luca2020
 
Excel Help (Creating a chart) Bart Geek Day 0 136
17th Jan 06 at 13:52
by Bart
 
PHP Gurus Dom Geek Day 7 240
23rd Nov 09 at 17:33
by Dom
 
Excel question Marc Geek Day 8 234
31st Aug 10 at 16:58
by dannymccann
 
Excel guru's Jambo Geek Day 3 268
24th Nov 11 at 19:31
by Ian
 

Corsa Sport » Message Board » Off Day » Geek Day » Excel question (array/multiple columns) 29 database queries in 0.0136700 seconds