need help if formula

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Need help with an IF formula

Need help with an IF formula

resolvedResolved · Urgent Priority · Version 2007

Katy has attended:
Excel Advanced course
PowerPoint Intermediate Advanced course

Need help with an IF formula

Good morning

I need help with a formula, I think it needs to be an IF formula but I'm not sure.

In column A I have the number of days worked in a year. In column B, I need to look at the no of days in column A and calculate number between 41 and 120. In column C, I need to look at the no days in column A again and calculate the no of days after 121 (if there are any).

I probably haven't explained that very well! Any help would be greatly appreciated :-)

RE: Need help with an IF formula

Hi Kate

You did explain it well. There are 2 methods that come to mind. One is to use a COUNTIFS function and the other is to use a Pivot Table.

I've made up some sample data in Column A so you can see which method is more practical

Countifs Method

To calculate 41-120
=COUNTIFS($A$2:$A$16,">40",$A$2:$A$16,"<121")
To calculate >120
=COUNTIF(A2:A16,">120")

Days
46
74
32
94
152
177
198
112
10
26
50
113
62
96
77

PivotTable method

With cursor in A1 choose Insert, Pivot table
Choose existing worksheet cell eg E5
Row Headings - Days
Value - Days - Summarize as Count
Then group the resulting data as follows (right click any value in the pivot table and choose Group)

Starting at 41
Ending at 120
By: 79

This is how the Pivot table displays:

Row Labels Count of Days
<41 3
41-120 9
>120 3
Grand Total 15

The Pivot table doesn't involve writing formulas but will need refreshing if data changes.
Hope that helps.

Doug Dunn
Best STL

Read more: https://www.stl-training.co.uk/post-34325-urgent-formula-help-needed.html #ixzz2m1v8JH85

Fri 6 Dec 2013: Automatically marked as resolved.

 

Training courses

 

Training information:

See also:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.


 

Excel tip:

Converting an American date format to European using Formula

Excel depending on your local setting will only pick up date values of the dd mmm yyyy oders as date type. If you import data from various sources including America their date order is different with data value in mmm dd yyyy, excel can only treat it as text indicated by left aligning it. To overcome this you have to do the the following.

1. Extract the date components mmm dd yyyy, by using the the Text functions LEFT, MID or RIGHT

2. Reorder dd mmm component and concatenate using "&" in the right order this will create a text string with the date in the right order it then needss to be converted to a value so excel can recognise it.

3. To convert to value encase in TEXT function.

4. Format to desired date format.

View all Excel hints and tips


Server loaded in 0.07 secs.