Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I use the following formula in my Google Spreadsheet:

QUERY(Inkomster!A2:G;"SELECT SUM(C) WHERE G="&B3&" AND F='"&A3&"'")

This returns the following (On two different rows that is)

H1=sum
H2=3720

I don't want the result of the query to return two rows, I'm not interested in the first row. Just the second one. How can I accomplish that?

share|improve this question

migrated from superuser.com Jan 26 '13 at 19:57

This question came from our site for computer enthusiasts and power users.

    
Your line of code is impossible to interpret without know what cells B3 and A3 are. –  KronoS Jan 15 '13 at 19:27
    
Can you give me some feedback on the answer I gave you? Did it work? –  Jacob Jan Tuinstra Jan 30 '13 at 17:28
    
Sorry about that. I tried it know and it did indeed work. However i'd already solved it using query without Sum, and then encapsulate the query method with sum(). –  Anton Gildebrand Jan 30 '13 at 17:59

1 Answer 1

up vote 3 down vote accepted

You can use the following formula for that:

INDEX(QUERY(Inkomster!A2:G;"SELECT SUM(C) WHERE G="&B3&" AND F='"&A3&"'"),2,0)

The 2 references the row number and the 0 or 1 references the column number

share|improve this answer
    
Thanks for this. This really needs be in the documentation for the QUERY function: support.google.com/drive/answer/3093343 –  Sean Glover Jan 4 at 15:24

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.