Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
lreque
 
Posts: n/a
Default If/Then Statement


I'm working on a worksheet and I need to write a formula - if the cells
in column a = January (or specified month), then add the cells in the
same row of column b. I want to compile date from an annual forecast
and I'd like to use a formula rather than doing it manually - is this
possible?


--
lreque
------------------------------------------------------------------------
lreque's Profile: http://www.excelforum.com/member.php...o&userid=30078
View this thread: http://www.excelforum.com/showthread...hreadid=497587

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Roger Govier
 
Posts: n/a
Default If/Then Statement

Hi

If the values in column A are true Excel dates e.g. 01/01/2006, then
=SUMPRODUCT(--(MONTH($A$1:$A$100)=1),$B$1:$B$100)

Change the =1 to =2 for Feb etc., or put the value required in another
cell. e.g cell C1, then
=SUMPRODUCT(--(MONTH($A$1:$A$100)=C1),$B$1:$B$100)

If the values in column A are text e.g. "January", then change formula
to
=SUMPRODUCT(--($A$1:$A$100)=C1),$B$1:$B$100)
and type January in C1

--
Regards

Roger Govier



lreque wrote:
I'm working on a worksheet and I need to write a formula - if the
cells in column a = January (or specified month), then add the cells
in the same row of column b. I want to compile date from an annual
forecast and I'd like to use a formula rather than doing it manually
- is this possible?


--
lreque
------------------------------------------------------------------------
lreque's Profile:
http://www.excelforum.com/member.php...o&userid=30078 View
this thread: http://www.excelforum.com/showthread...hreadid=497587



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Duke Carey
 
Posts: n/a
Default If/Then Statement

If col A contains the word January

=SUMIF(A1:A1000, "January",B1:B1000)

If col A contains dates

=SUMPRODUCT(--(MONTH(A1:A1000)=1),B1:B1000)

change the MONTH(A1:A1000)=1 to MONTH(A1:A1000)=2 for Feb, etc.

"lreque" wrote:


I'm working on a worksheet and I need to write a formula - if the cells
in column a = January (or specified month), then add the cells in the
same row of column b. I want to compile date from an annual forecast
and I'd like to use a formula rather than doing it manually - is this
possible?


--
lreque
------------------------------------------------------------------------
lreque's Profile: http://www.excelforum.com/member.php...o&userid=30078
View this thread: http://www.excelforum.com/showthread...hreadid=497587


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Coderre
 
Posts: n/a
Default If/Then Statement


That can be done, but it depends on the contents of Col_A.

If Col_A contains text....Jan, Feb, etc..you could use a variation of:
=SUMIF(A1:A100,"Jan",B1:B100)

If Col_A contains dates....1/1/2006, 2/1/2006, etc..you'll need
something like this:

For January...
=SUMPRODUCT(--(ISNUMBER(A1:A100)),--(MONTH(A1:A100)=1),B1:B100)

For February...
=SUMPRODUCT(--(ISNUMBER(A1:A100)),--(MONTH(A1:A100)=2),B1:B100)

You might also be able to use a Pivot Table.

Does that help?

Regards,
Ron


--
Ron Coderre
------------------------------------------------------------------------
Ron Coderre's Profile: http://www.excelforum.com/member.php...o&userid=21419
View this thread: http://www.excelforum.com/showthread...hreadid=497587

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
lreque
 
Posts: n/a
Default If/Then Statement


=SUMIF(G1:G1000,"January",I1:I1000) did it!!!

- didn't figure it would be that simple - thanks for all the advice
and the quick response!


--
lreque
------------------------------------------------------------------------
lreque's Profile: http://www.excelforum.com/member.php...o&userid=30078
View this thread: http://www.excelforum.com/showthread...hreadid=497587

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
If statement Matt Montagliano Excel Discussion (Misc queries) 1 September 8th 05 08:47 PM
if/then statement that results in Yes/No Patty via OfficeKB.com Excel Discussion (Misc queries) 3 August 3rd 05 02:26 PM
Next w/o For If/Then Loop littlegreenmen1 Excel Discussion (Misc queries) 5 June 9th 05 05:28 PM
Do I need a sumif or sum of a vlookup formula? PeterB Excel Worksheet Functions 0 June 1st 05 12:23 PM
If/Then statement A Ford Excel Discussion (Misc queries) 5 December 2nd 04 04:45 PM


All times are GMT +1. The time now is 06:22 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"