Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Statler
 
Posts: n/a
Default My If+If+If etc.. is too long! Anyone know a better way?!

Hi. I have this formula:
=(IF(($Q10=$C$10)*($Q10<=$D$10),J$10,0))
+(IF(($Q10=$C$11)*($Q10<=$D$11),J$11,0))...and so on

which means:
if (startdate = date or enddate<= date) show value in J and if not, show 0

....and I need it to do this for every day in a month. However, a/ Excel
won't let me nest 31 if functions like this and b/ it's a real pain typing it
out for every month!

Does anyone know a better way? Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Tarburton
 
Posts: n/a
Default My If+If+If etc.. is too long! Anyone know a better way?!

how about
=SUMPRODUCT(($C$10:$C$40=startdate)*($D$10:$D$40< =enddate)*($J$10:$J$40))
Or reverse the start and end date if I just switched them on you

"Statler" wrote in message
...
Hi. I have this formula:
=(IF(($Q10=$C$10)*($Q10<=$D$10),J$10,0))
+(IF(($Q10=$C$11)*($Q10<=$D$11),J$11,0))...and so on

which means:
if (startdate = date or enddate<= date) show value in J and if not, show
0

...and I need it to do this for every day in a month. However, a/ Excel
won't let me nest 31 if functions like this and b/ it's a real pain typing
it
out for every month!

Does anyone know a better way? Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Statler
 
Posts: n/a
Default My If+If+If etc.. is too long! Anyone know a better way?!

Thanks for responding! I can't get that to work though...
I'll add to my explaination which may help:
The sales team can put in the start and end date of a campaign in two
columns (e.g. 1st Feb in A and 5th Feb in B) and the number of items sold in
C (e.g. 100). I need a formula (currentlymy set of if's!) that says, 'Check
todays date to see if it falls inbetween ANY of the date sets that the sales
team have put in (they need to put in lots of different sets on different
timescales) and if it does, show the number they have to sell that day. Using
the figures above, on the 5th Feb, the formula should return 20 (100 items, 5
days = 20/day). then if another sales input was 5th Feb- 9th Feb, 100 items,
the formula should show 20 for the 1, 2,3,4 of Feb, then 40 for the 5th (two
sales sets on that day both of 20) then 20 again for the 6, 7,8,9th and zero
for the 10th onwards...

Whew! If that makes sense and you can offer anything further then I'll be
hugely grateful! (And very impressed!)

Thanks!

=SUMPRODUCT(($C$10:$C$40=startdate)*($D$10:$D$40< =enddate)*($J$10:$J$40))
Or reverse the start and end date if I just switched them on you
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Tarburton
 
Posts: n/a
Default My If+If+If etc.. is too long! Anyone know a better way?!

Try this
=SUMPRODUCT(($A$10:$A$40<=TODAY())*($B$10:$B$40=T ODAY())*($C$10:$C$40/($B$10:$B$40-$A$10:$A$40+1)))

You can exchange the TODAY() calls with a pointer to date.

"Statler" wrote in message
...
Thanks for responding! I can't get that to work though...
I'll add to my explaination which may help:
The sales team can put in the start and end date of a campaign in two
columns (e.g. 1st Feb in A and 5th Feb in B) and the number of items sold
in
C (e.g. 100). I need a formula (currentlymy set of if's!) that says,
'Check
todays date to see if it falls inbetween ANY of the date sets that the
sales
team have put in (they need to put in lots of different sets on different
timescales) and if it does, show the number they have to sell that day.
Using
the figures above, on the 5th Feb, the formula should return 20 (100
items, 5
days = 20/day). then if another sales input was 5th Feb- 9th Feb, 100
items,
the formula should show 20 for the 1, 2,3,4 of Feb, then 40 for the 5th
(two
sales sets on that day both of 20) then 20 again for the 6, 7,8,9th and
zero
for the 10th onwards...

Whew! If that makes sense and you can offer anything further then I'll be
hugely grateful! (And very impressed!)

Thanks!

=SUMPRODUCT(($C$10:$C$40=startdate)*($D$10:$D$40< =enddate)*($J$10:$J$40))
Or reverse the start and end date if I just switched them on you



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Tarburton
 
Posts: n/a
Default My If+If+If etc.. is too long! Anyone know a better way?!

My previous will include fractions, this one gets rid of them
=SUMPRODUCT(($A$10:$A$40<=TODAY())*($B$10:$B$40=T ODAY())*(INT($C$10:$C$40/($B$10:$B$40-$A$10:$A$40+1))))+SUMPRODUCT(($A$10:$A$40<=TODAY() )*($B$10:$B$40=TODAY())*(MOD($C$10:$C$40,($B$10:$ B$40-$A$10:$A$40+1))=(TODAY()-$A$10:$A$40+1)))
If you have an even product, say you need to seel 15 in 6 days =2.5 per day,
this will give you 3 for each of the first 3 days and 2 for the last 3 days.
Should work, test it.


"Statler" wrote in message
...
Thanks for responding! I can't get that to work though...
I'll add to my explaination which may help:
The sales team can put in the start and end date of a campaign in two
columns (e.g. 1st Feb in A and 5th Feb in B) and the number of items sold
in
C (e.g. 100). I need a formula (currentlymy set of if's!) that says,
'Check
todays date to see if it falls inbetween ANY of the date sets that the
sales
team have put in (they need to put in lots of different sets on different
timescales) and if it does, show the number they have to sell that day.
Using
the figures above, on the 5th Feb, the formula should return 20 (100
items, 5
days = 20/day). then if another sales input was 5th Feb- 9th Feb, 100
items,
the formula should show 20 for the 1, 2,3,4 of Feb, then 40 for the 5th
(two
sales sets on that day both of 20) then 20 again for the 6, 7,8,9th and
zero
for the 10th onwards...

Whew! If that makes sense and you can offer anything further then I'll be
hugely grateful! (And very impressed!)

Thanks!

=SUMPRODUCT(($C$10:$C$40=startdate)*($D$10:$D$40< =enddate)*($J$10:$J$40))
Or reverse the start and end date if I just switched them on you





  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Tarburton
 
Posts: n/a
Default My If+If+If etc.. is too long! Anyone know a better way?!

I can shorten that a bit
=SUMPRODUCT(($A$10:$A$40<=TODAY())*($B$10:$B$40=T ODAY())*(INT($C$10:$C$40/($B$10:$B$40-$A$10:$A$40+1))+(MOD($C$10:$C$40,($B$10:$B$40-$A$10:$A$40+1))=(TODAY()-$A$10:$A$40+1))))
Again, you can point the TODAY() calls at the date, copy down next to the
days of the month to make a forecast for the month.

"Bob Tarburton" wrote in message
...
My previous will include fractions, this one gets rid of them
=SUMPRODUCT(($A$10:$A$40<=TODAY())*($B$10:$B$40=T ODAY())*(INT($C$10:$C$40/($B$10:$B$40-$A$10:$A$40+1))))+SUMPRODUCT(($A$10:$A$40<=TODAY() )*($B$10:$B$40=TODAY())*(MOD($C$10:$C$40,($B$10:$ B$40-$A$10:$A$40+1))=(TODAY()-$A$10:$A$40+1)))
If you have an even product, say you need to seel 15 in 6 days =2.5 per
day, this will give you 3 for each of the first 3 days and 2 for the last
3 days.
Should work, test it.


"Statler" wrote in message
...
Thanks for responding! I can't get that to work though...
I'll add to my explaination which may help:
The sales team can put in the start and end date of a campaign in two
columns (e.g. 1st Feb in A and 5th Feb in B) and the number of items sold
in
C (e.g. 100). I need a formula (currentlymy set of if's!) that says,
'Check
todays date to see if it falls inbetween ANY of the date sets that the
sales
team have put in (they need to put in lots of different sets on different
timescales) and if it does, show the number they have to sell that day.
Using
the figures above, on the 5th Feb, the formula should return 20 (100
items, 5
days = 20/day). then if another sales input was 5th Feb- 9th Feb, 100
items,
the formula should show 20 for the 1, 2,3,4 of Feb, then 40 for the 5th
(two
sales sets on that day both of 20) then 20 again for the 6, 7,8,9th and
zero
for the 10th onwards...

Whew! If that makes sense and you can offer anything further then I'll be
hugely grateful! (And very impressed!)

Thanks!

=SUMPRODUCT(($C$10:$C$40=startdate)*($D$10:$D$40< =enddate)*($J$10:$J$40))
Or reverse the start and end date if I just switched them on you





  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Statler
 
Posts: n/a
Default My If+If+If etc.. is too long! Anyone know a better way?!

Yes! Yes! Yes!

That works! Brilliant Bob, thanks soooo much! I don't quite understand it
yet but I can now go away and find out what the INT and MOD functions do (and
maybe swot up on the SUMPRODUCT too!) and then work back through so I can
grasp exactly what is going on there - but it's great to be able to do it
that way around rather than give up in frustration trying to work from the
start upwards!

Thanks again so much for your time.

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Tarburton
 
Posts: n/a
Default My If+If+If etc.. is too long! Anyone know a better way?!

Sumproduct is explained at
http://www.xldynamic.com/source/xld.SUMPRODUCT.html

INT(x) is essentially the same as ROUNDDOWN(x,0)
MOD(x,y) gives the remainder of x/y.

Glad to help and to finally get it right.

"Statler" wrote in message
...
Yes! Yes! Yes!

That works! Brilliant Bob, thanks soooo much! I don't quite understand it
yet but I can now go away and find out what the INT and MOD functions do
(and
maybe swot up on the SUMPRODUCT too!) and then work back through so I can
grasp exactly what is going on there - but it's great to be able to do it
that way around rather than give up in frustration trying to work from the
start upwards!

Thanks again so much for your time.



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
More than 3 conditional formats? Ltat42a Excel Discussion (Misc queries) 12 January 6th 06 11:26 AM
Format cells with a formula (7 conditions). danindenver Excel Discussion (Misc queries) 3 January 2nd 06 02:40 PM
Date & Time mully New Users to Excel 4 May 23rd 05 11:56 AM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM


All times are GMT +1. The time now is 12:17 PM.

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"