PC Review


Reply
Thread Tools Rate Thread

Conditional Sum

 
 
dksoreal
Guest
Posts: n/a
 
      3rd Nov 2003

Probably a simple solution, but I am struggling.

Here is what I am trying to do. I have months Jan through Dec in a row
with corresponding data below it for a few variables. I want to be
able to input a date and have the formula calculate the total for a
variable up to that date. For example: If I wanted the YTD for March,
I would input "March" in a cell and the formula would know to sum Jan -
Mar in the data table and return the YTD value.

Any suggestions?


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

 
Reply With Quote
 
 
 
 
Debra Dalgleish
Guest
Posts: n/a
 
      3rd Nov 2003
With "March" in cell A5:

=SUM(INDIRECT("A2:" & ADDRESS(2,MATCH(A5,A1:L1,0))))

dksoreal wrote:
> Probably a simple solution, but I am struggling.
>
> Here is what I am trying to do. I have months Jan through Dec in a row
> with corresponding data below it for a few variables. I want to be
> able to input a date and have the formula calculate the total for a
> variable up to that date. For example: If I wanted the YTD for March,
> I would input "March" in a cell and the formula would know to sum Jan -
> Mar in the data table and return the YTD value.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

 
Reply With Quote
 
Debra Dalgleish
Guest
Posts: n/a
 
      3rd Nov 2003
Or the shorter formula:

=SUM(OFFSET(A2,0,0,1,MATCH(A5,A1:L1,0)))

Debra Dalgleish wrote:
> With "March" in cell A5:
>
> =SUM(INDIRECT("A2:" & ADDRESS(2,MATCH(A5,A1:L1,0))))
>
> dksoreal wrote:
>
>> Probably a simple solution, but I am struggling.
>>
>> Here is what I am trying to do. I have months Jan through Dec in a row
>> with corresponding data below it for a few variables. I want to be
>> able to input a date and have the formula calculate the total for a
>> variable up to that date. For example: If I wanted the YTD for March,
>> I would input "March" in a cell and the formula would know to sum Jan -
>> Mar in the data table and return the YTD value.


--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

 
Reply With Quote
 
ryanb.
Guest
Posts: n/a
 
      3rd Nov 2003
I like to use numbers as opposed to typing in the name of the month (i.e.
1=Jan, 2=Feb, 3=Mar, etc). This allows you to use v/hlookup, sumproduct, or
index/match. I use this for the company sales reports where A1 is the month
cell, and the entire report updates to show the current month and YTD v.
prior year... based on the month number in A1 and the year in A2. I also
have one that displays the trailing 12 months sales trend based on the month
in A1. I just find that you are less likely to have an input error using
numbers.

something to consider,

ryanb.


"Debra Dalgleish" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Or the shorter formula:
>
> =SUM(OFFSET(A2,0,0,1,MATCH(A5,A1:L1,0)))
>
> Debra Dalgleish wrote:
> > With "March" in cell A5:
> >
> > =SUM(INDIRECT("A2:" & ADDRESS(2,MATCH(A5,A1:L1,0))))
> >
> > dksoreal wrote:
> >
> >> Probably a simple solution, but I am struggling.
> >>
> >> Here is what I am trying to do. I have months Jan through Dec in a row
> >> with corresponding data below it for a few variables. I want to be
> >> able to input a date and have the formula calculate the total for a
> >> variable up to that date. For example: If I wanted the YTD for March,
> >> I would input "March" in a cell and the formula would know to sum Jan -
> >> Mar in the data table and return the YTD value.

>
> --
> Debra Dalgleish
> Excel FAQ, Tips & Book List
> http://www.contextures.com/tiptech.html
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to apply a conditional Select distinct (or conditional Where onduplicated cell values in a column) Jamie Microsoft Access Queries 3 2nd Oct 2009 07:39 PM
Conditional Formatting No Longer Conditional in 2007 Beta =?Utf-8?B?Q2FjdHVhci1Oby1KdXRzdQ==?= Microsoft Excel Crashes 0 17th Nov 2006 10:01 PM
Using query results within Conditional Statement...sequenced conditional queries rafael.farias.jr@gmail.com Microsoft Access 3 30th Aug 2006 02:08 PM
Conditional Formatting that will display conditional data =?Utf-8?B?QnJhaW5GYXJ0?= Microsoft Excel Worksheet Functions 1 13th Sep 2005 05:45 PM
Re: Multiple conditional on conditional format formula Bob Phillips Microsoft Excel Programming 0 27th Jul 2004 05:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:01 PM.